writing tests for deleting tickets after unregistering
writing tests for deleting tickets after unregistering
This commit is contained in:
parent
e94fabbaa8
commit
e826bb85eb
1 changed files with 13 additions and 0 deletions
|
|
@ -22,4 +22,17 @@ describe 'Registration' do
|
|||
end
|
||||
end
|
||||
end
|
||||
describe 'after destroy' do
|
||||
it 'destroys purchased tickets' do
|
||||
conference = build(:conference)
|
||||
registration1 = build(:registration, conference: conference)
|
||||
registration1.save
|
||||
ticket_purchase = build(:ticket_purchase, conference: conference)
|
||||
ticket_purchase.save
|
||||
expect(conference.ticket_purchases.size).to be 1
|
||||
registration1.destroy
|
||||
expect(conference.registrations.size).to be 0
|
||||
expect(conference.ticket_purchases.size).to be 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue