registration#delete: retain ticket purchases
This commit is contained in:
parent
85fcd4e1b7
commit
d1c0c7d97a
5 changed files with 55 additions and 28 deletions
|
|
@ -90,23 +90,4 @@ describe 'Registration' do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#destroy_purchased_tickets' do
|
||||
it 'destroys purchased tickets if tickets are purchased' do
|
||||
create(:ticket_purchase, conference: conference, user: user)
|
||||
expect(user.registrations.size).to be 1
|
||||
expect(user.ticket_purchases.size).to be 1
|
||||
registration.destroy
|
||||
expect(user.registrations.size).to be 0
|
||||
expect(user.ticket_purchases.size).to be 0
|
||||
end
|
||||
|
||||
it 'destroys no tickets if no tickets are purchased' do
|
||||
expect(user.registrations.size).to be 1
|
||||
expect(user.ticket_purchases.size).to be 0
|
||||
registration.destroy
|
||||
expect(user.registrations.size).to be 0
|
||||
expect(user.ticket_purchases.size).to be 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue