Skip to content

Commit

Permalink
Added spec
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchambo committed Jul 4, 2017
1 parent e4d2d57 commit 6460015
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/booking_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,16 @@
end
end
end

describe QuickTravel::Booking, "when booking doesn't exist" do
let(:booking) { QuickTravel::Booking.find_by_reference('111111') }

it 'should raise an error' do
VCR.use_cassette('booking_non_existant') do
expect{ booking }.to raise_error(QuickTravel::AdapterError) { |exception|
expect(exception.status).to eq 404
expect(exception.response).to eq({'error' => "Booking not found. It may have been removed due to inactivity"})
}
end
end
end
59 changes: 59 additions & 0 deletions spec/support/cassettes/booking_non_existant.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6460015

Please sign in to comment.