Sha256: 4647e2dbaec6de51f4f4d179aa3a77d0cd3ff274e506d9ff2e98152496af2619
Contents?: true
Size: 664 Bytes
Versions: 15
Compression:
Stored size: 664 Bytes
Contents
RSpec.describe SolidusBactracs::Api::RateLimitedError do describe '.from_response' do it 'extracts the status code, body, headers and retry time from the response' do response = instance_double( 'HTTParty::Response', code: 429, headers: { 'X-Rate-Limit-Reset' => 20 }, body: '{ "message": "Too Many Requests" }', ) error = described_class.from_response(response) expect(error).to have_attributes( response_code: 429, response_headers: { 'X-Rate-Limit-Reset' => 20 }, response_body: '{ "message": "Too Many Requests" }', retry_in: 20.seconds, ) end end end
Version data entries
15 entries across 15 versions & 1 rubygems