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.5 spec/api_client/connection/oauth_spec.rb
api_client-0.5.4 spec/api_client/connection/oauth_spec.rb
api_client-0.5.3 spec/api_client/connection/oauth_spec.rb
api_client-0.5.2 spec/api_client/connection/oauth_spec.rb
api_client-0.5.1 spec/api_client/connection/oauth_spec.rb
api_client-0.5.0 spec/api_client/connection/oauth_spec.rb