Sha256: 69ba33aadf280c18d4709e821f0669d7be07291f78a09770727935b1b3459627

Contents?: true

Size: 659 Bytes

Versions: 11

Compression:

Stored size: 659 Bytes

Contents

require File.expand_path('../../spec_helper', __FILE__)

describe Faraday::Response do
  before do
    @client = Instagram::Client.new
  end

  {
    400 => Instagram::BadRequest,
    404 => Instagram::NotFound,
    500 => Instagram::InternalServerError,
    503 => Instagram::ServiceUnavailable
  }.each do |status, exception|
    context "when HTTP status is #{status}" do

      before do
        stub_get('users/self/feed.json').
          to_return(:status => status)
      end

      it "should raise #{exception.name} error" do
        lambda do
          @client.user_media_feed()
        end.should raise_error(exception)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
instagram-0.8.3 spec/faraday/response_spec.rb
instagram-0.8.2 spec/faraday/response_spec.rb
instagram-fixed-0.8.1 spec/faraday/response_spec.rb
instagram-fixed-0.8 spec/faraday/response_spec.rb
instagram-innonate-0.8 spec/faraday/response_spec.rb
instagram-0.8 spec/faraday/response_spec.rb
instagram-0.7 spec/faraday/response_spec.rb
instagram-0.6.2 spec/faraday/response_spec.rb
localist-instagvram-0.6.2 spec/faraday/response_spec.rb
instagram-0.6.1 spec/faraday/response_spec.rb
instagram-0.6 spec/faraday/response_spec.rb