Sha256: 4516c0df5b02473451e866b5c24235861ebbbcab0984ee2e97e90fd353f0d797

Contents?: true

Size: 884 Bytes

Versions: 26

Compression:

Stored size: 884 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 = double
    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

26 entries across 26 versions & 1 rubygems

Version Path
api_client-0.5.26-java spec/api_client/connection/oauth_spec.rb
api_client-0.5.26 spec/api_client/connection/oauth_spec.rb
api_client-0.5.25-java spec/api_client/connection/oauth_spec.rb
api_client-0.5.25 spec/api_client/connection/oauth_spec.rb
api_client-0.5.24 spec/api_client/connection/oauth_spec.rb
api_client-0.5.22 spec/api_client/connection/oauth_spec.rb
api_client-0.5.21 spec/api_client/connection/oauth_spec.rb
api_client-0.5.20 spec/api_client/connection/oauth_spec.rb
api_client-0.5.19 spec/api_client/connection/oauth_spec.rb
api_client-0.5.18 spec/api_client/connection/oauth_spec.rb
api_client-0.5.17 spec/api_client/connection/oauth_spec.rb
api_client-0.5.16 spec/api_client/connection/oauth_spec.rb
api_client-0.5.15 spec/api_client/connection/oauth_spec.rb
api_client-0.5.14 spec/api_client/connection/oauth_spec.rb
api_client-0.5.13 spec/api_client/connection/oauth_spec.rb
api_client-0.5.12 spec/api_client/connection/oauth_spec.rb
api_client-0.5.11 spec/api_client/connection/oauth_spec.rb
api_client-0.5.9 spec/api_client/connection/oauth_spec.rb
api_client-0.5.7 spec/api_client/connection/oauth_spec.rb
api_client-0.5.6 spec/api_client/connection/oauth_spec.rb