Sha256: c8d313b45c4e343db0fe6e073ffb86ab91e9538952a19e87722fc84c9076ea7f

Contents?: true

Size: 877 Bytes

Versions: 15

Compression:

Stored size: 877 Bytes

Contents

require 'spec_helper'

describe Restforce::Middleware::Authentication::Token do
  let(:options) do
    { host: 'login.salesforce.com',
      refresh_token: 'refresh_token',
      client_id: 'client_id',
      client_secret: 'client_secret',
      adapter: :net_http }
  end

  it_behaves_like 'authentication middleware' do
    let(:success_request) do
      stub_login_request(
        body: "grant_type=refresh_token&refresh_token=refresh_token&" \
                 "client_id=client_id&client_secret=client_secret"
      ).to_return(status: 200, body: fixture(:auth_success_response))
    end

    let(:fail_request) do
      stub_login_request(
        body: "grant_type=refresh_token&refresh_token=refresh_token&" \
                 "client_id=client_id&client_secret=client_secret"
      ).to_return(status: 400, body: fixture(:refresh_error_response))
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
restforce-2.5.4 spec/unit/middleware/authentication/token_spec.rb
restforce-2.5.3 spec/unit/middleware/authentication/token_spec.rb
restforce-2.5.2 spec/unit/middleware/authentication/token_spec.rb
restforce-2.5.1 spec/unit/middleware/authentication/token_spec.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/restforce-2.4.2/spec/unit/middleware/authentication/token_spec.rb
restforce-2.5.0 spec/unit/middleware/authentication/token_spec.rb
restforce-2.4.2 spec/unit/middleware/authentication/token_spec.rb
restforce-2.4.1 spec/unit/middleware/authentication/token_spec.rb
restforce-2.4.0 spec/unit/middleware/authentication/token_spec.rb
restforce-2.3.0 spec/unit/middleware/authentication/token_spec.rb
restforce-2.2.1 spec/unit/middleware/authentication/token_spec.rb
restforce-2.2.0 spec/unit/middleware/authentication/token_spec.rb
restforce-2.1.3 spec/unit/middleware/authentication/token_spec.rb
restforce-2.1.2 spec/unit/middleware/authentication/token_spec.rb
restforce-2.1.1 spec/unit/middleware/authentication/token_spec.rb