From 297b1f8c8ae273ba5aaf0a7b019c49afd7b6d8d8 Mon Sep 17 00:00:00 2001 From: Rishabh Saxena Date: Thu, 10 Mar 2016 21:44:18 +0530 Subject: [PATCH] Adding tests for tickets deletion. --- spec/controllers/admin/registration_periods_controller_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/controllers/admin/registration_periods_controller_spec.rb b/spec/controllers/admin/registration_periods_controller_spec.rb index 6daf08d8..ef6ffdba 100644 --- a/spec/controllers/admin/registration_periods_controller_spec.rb +++ b/spec/controllers/admin/registration_periods_controller_spec.rb @@ -145,6 +145,9 @@ describe Admin::RegistrationPeriodsController do it 'it deletes the registration period' do expect { delete :destroy, conference_id: conference.short_title }.to change(RegistrationPeriod, :count).by(-1) 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 delete :destroy, conference_id: conference.short_title expect(response).to redirect_to admin_conference_registration_period_path