registration#delete: retain ticket purchases

This commit is contained in:
Rishabh Saxena 2016-09-26 20:57:11 +05:30
parent 85fcd4e1b7
commit d1c0c7d97a
No known key found for this signature in database
GPG key ID: FA3BDC38A9CB6807
5 changed files with 55 additions and 28 deletions

View file

@ -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