Skip to content

Commit

Permalink
Add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Filho committed Oct 28, 2015
1 parent e34c6de commit 3781e61
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
expect(BraspagRest::Response.new(gateway_response)).not_to be_success
end
end

context 'when gateway returns an error' do
let(:gateway_response) { Hashie::Mash.new(body: 'an error happened') }

it 'returns false' do
expect(BraspagRest::Response.new(gateway_response)).not_to be_success
end
end
end

describe '#parsed_body' do
Expand Down

0 comments on commit 3781e61

Please sign in to comment.