Adding tests for tickets deletion.

This commit is contained in:
Rishabh Saxena 2016-03-10 21:44:18 +05:30
parent 5a19d47376
commit 297b1f8c8a

View file

@ -145,6 +145,9 @@ describe Admin::RegistrationPeriodsController do
it 'it deletes the registration period' do it 'it deletes the registration period' do
expect { delete :destroy, conference_id: conference.short_title }.to change(RegistrationPeriod, :count).by(-1) expect { delete :destroy, conference_id: conference.short_title }.to change(RegistrationPeriod, :count).by(-1)
end end
it 'it deletes the conference tickets' do
expect { delete :destroy, conference_id: conference.short_title }.to change(TicketPurchase, :count).by(-1)
end
it 'redirects to users#show' do it 'redirects to users#show' do
delete :destroy, conference_id: conference.short_title delete :destroy, conference_id: conference.short_title
expect(response).to redirect_to admin_conference_registration_period_path expect(response).to redirect_to admin_conference_registration_period_path