Sha256: 2a763156046d7816fd4ba54ed3f0ce00d30db58d0b662d2c8da515d089ef8f9a

Contents?: true

Size: 694 Bytes

Versions: 28

Compression:

Stored size: 694 Bytes

Contents

require "spec_helper"

describe ApiClient::Connection::Middlewares::Request::OAuth do

  it "adds a oauth header to the request" do
    app = double
    options = {
      :token => 'TOKEN',
      :token_secret => 'SECRET',
      :consumer_key => 'CONSUMER_KEY',
      :consumer_secret => 'CONSUMER_SECRET'
    }
    instance = ApiClient::Connection::Middlewares::Request::OAuth.new(app, options)
    env = {
      :url => "http://api.twitter.com",
      :request_headers => {}
    }
    app.should_receive(:call).with(env)

    instance.call(env)
    env[:request_headers]['Authorization'].should match("OAuth")
    env[:request_headers]['User-Agent'].should match("ApiClient gem")

  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

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