Sha256: 88f64398116aadd5121aeb5c9307a19f3334069689f6a8458ee008c8c6980112

Contents?: true

Size: 882 Bytes

Versions: 19

Compression:

Stored size: 882 Bytes

Contents

require "spec_helper"

describe ApiClient::Connection::Oauth do

  it "adds basic middlewares to faraday" do
    instance = ApiClient::Connection::Oauth.new("http://google.com")
    instance.handler.builder.handlers.collect(&:name).should == [
      "ApiClient::Connection::Middlewares::Request::OAuth",
      "Faraday::Request::UrlEncoded",
      "Faraday::Adapter::NetHttp"
    ]
  end

  it "adds the logger middlewares to faraday if ApiClient.logger is available" do
    logger = mock
    ApiClient.stub(:logger).and_return(logger)
    instance = ApiClient::Connection::Oauth.new("http://google.com")
    instance.handler.builder.handlers.collect(&:name).should == [
      "ApiClient::Connection::Middlewares::Request::Logger",
      "ApiClient::Connection::Middlewares::Request::OAuth",
      "Faraday::Request::UrlEncoded",
      "Faraday::Adapter::NetHttp"
    ]

  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
api_client-0.4.3 spec/api_client/connection/oauth_spec.rb
api_client-0.4.2 spec/api_client/connection/oauth_spec.rb
api_client-0.4.1 spec/api_client/connection/oauth_spec.rb
api_client-0.3.3 spec/api_client/connection/oauth_spec.rb
api_client-0.4.0 spec/api_client/connection/oauth_spec.rb
api_client-0.3.2 spec/api_client/connection/oauth_spec.rb
api_client-0.3.1 spec/api_client/connection/oauth_spec.rb
api_client-0.3.0 spec/api_client/connection/oauth_spec.rb
api_client-0.2.0 spec/api_client/connection/oauth_spec.rb
api_client-0.1.9 spec/api_client/connection/oauth_spec.rb
api_client-0.1.8 spec/api_client/connection/oauth_spec.rb
api_client-0.1.7 spec/api_client/connection/oauth_spec.rb
api_client-0.1.6 spec/api_client/connection/oauth_spec.rb
api_client-0.1.5 spec/api_client/connection/oauth_spec.rb
api_client-0.1.4 spec/api_client/connection/oauth_spec.rb
api_client-0.1.3 spec/api_client/connection/oauth_spec.rb
api_client-0.1.2 spec/api_client/connection/oauth_spec.rb
api_client-0.1.1 spec/api_client/connection/oauth_spec.rb
api_client-0.1.0 spec/api_client/connection/oauth_spec.rb