mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
conference: refactor code and tests
This commit is contained in:
parent
53291e25b5
commit
fe828d24db
2 changed files with 2 additions and 2 deletions
|
|
@ -654,7 +654,7 @@ class Conference < ActiveRecord::Base
|
|||
# after the conference has been successfully created
|
||||
# Will create 1 new record for 'free' ticket
|
||||
def create_free_ticket
|
||||
ticket = Ticket.where(conference: self, title: 'Free Access', price_cents: 0).first_or_create!(description: 'Get free access tickets for the conference.')
|
||||
tickets.where(title: 'Free Access', price_cents: 0).first_or_create!(description: 'Get free access tickets for the conference.')
|
||||
end
|
||||
|
||||
##
|
||||
|
|
|
|||
|
|
@ -1588,7 +1588,7 @@ describe Conference do
|
|||
let!(:conference) { create(:conference) }
|
||||
|
||||
it 'creates free tickets' do
|
||||
free_ticket = Ticket.find_by(conference: conference)
|
||||
free_ticket = conference.tickets.first
|
||||
expect(free_ticket).not_to be_nil
|
||||
expect(free_ticket.price_cents).to eq(0)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue