Sha256: 9057a2620f0dfdac64eb4c8fbc1e982d547addfb51d7092fb79513454277529f
Contents?: true
Size: 607 Bytes
Versions: 8
Compression:
Stored size: 607 Bytes
Contents
RSpec.describe SolidusBacktracs::Api::RequestError do describe '.from_response' do it 'extracts the status code, body and headers from the response' do response = instance_double( 'HTTParty::Response', code: 500, headers: { 'Key' => 'Value' }, body: '{ "message": "Internal Server Error" }', ) error = described_class.from_response(response) expect(error).to have_attributes( response_code: 500, response_headers: { 'Key' => 'Value' }, response_body: '{ "message": "Internal Server Error" }', ) end end end
Version data entries
8 entries across 8 versions & 2 rubygems