Sha256: 7db36422361cf5112a776fa17a9f8bb0d6533fd4ff43fec2d25dfb239d005ed5
Contents?: true
Size: 761 Bytes
Versions: 4
Compression:
Stored size: 761 Bytes
Contents
require 'helper' describe Faraday::Response do before do @client = Desk::Client.new end { 400 => Desk::BadRequest, 401 => Desk::Unauthorized, 403 => Desk::Forbidden, 404 => Desk::NotFound, 406 => Desk::NotAcceptable, 429 => Desk::EnhanceYourCalm, 500 => Desk::InternalServerError, 502 => Desk::BadGateway, 503 => Desk::ServiceUnavailable, }.each do |status, exception| context "when HTTP status is #{status}" do before do stub_get('users/1'). with(:headers => {'Accept'=>'application/json', 'User-Agent'=>Desk::Configuration::DEFAULT_USER_AGENT}). to_return(:status => status) end it { expect{ @client.user(1) }.to raise_error(exception) } end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
desk-1.0.4 | spec/faraday/response_spec.rb |
desk-1.0.3 | spec/faraday/response_spec.rb |
desk-1.0.2 | spec/faraday/response_spec.rb |
desk-1.0.1 | spec/faraday/response_spec.rb |