improve tests[WIP]

This commit is contained in:
Rishabh Saxena 2016-06-18 18:33:36 +05:30
parent 809e2b7156
commit ee71456060
3 changed files with 33 additions and 25 deletions

View file

@ -40,9 +40,9 @@ describe ConferenceRegistrationsController, type: :controller do
get :show, conference_id: conference.short_title
end
it 'assigns price of purchased tickets to total_price and purchased tickets to tickets' do
expect(assigns(:total_price)).to eq Money.new(10000, 'USD')
expect(assigns(:tickets)).to match_array [@purchased_ticket]
it 'does not assign price of purchased tickets to total_price and purchased tickets to tickets without payment' do
expect(assigns(:total_price)).to eq Money.new(0, 'USD')
expect(assigns(:tickets)).not_to match_array [@purchased_ticket]
end
end