spec/lib/itrp/response_spec.rb in itrp-client-1.1.4 vs spec/lib/itrp/response_spec.rb in itrp-client-1.1.5

- old
+ new

@@ -91,13 +91,13 @@ it 'should add a message if the JSON body cannot be parsed' do stub_request(:get, 'https://api.itrp.com/v1/organizations').with(basic_auth: ['secret', 'x']).to_return(body: '==$$!invalid') response = @client.get('organizations') - message = "Invalid JSON - 757: unexpected token at '==$$!invalid' for:\n#{response.body}" - expect(response.json[:message]).to eq(message) - expect(response.json['message']).to eq(message) - expect(response.message).to eq(message) + message = "unexpected token at '==$$!invalid' for:\n#{response.body}" + expect(response.json[:message]).to include(message) + expect(response.json['message']).to include(message) + expect(response.message).to include(message) end it 'should have a blank message when single record is succesfully retrieved' do expect(@response_hash.message).to be_nil end