Sha256: b10d5a779ea32eaa6d92ae675a33ecd2d0c375c60d256e2bc8c0821cd61cc33d

Contents?: true

Size: 572 Bytes

Versions: 8

Compression:

Stored size: 572 Bytes

Contents

require 'spec_helper'

describe Rack::OAuth2::AccessToken::Bearer do
  let :token do
    Rack::OAuth2::AccessToken::Bearer.new(
      access_token: 'access_token'
    )
  end
  let(:resource_endpoint) { 'https://server.example.com/resources/fake' }
  let(:request) { Faraday::Request.new(:post, URI.parse(resource_endpoint), '', {hello: "world"}, {}) }

  describe '.authenticate' do
    it 'should set Authorization header' do
      expect(request.headers).to receive(:[]=).with('Authorization', 'Bearer access_token')
      token.authenticate(request)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rack-oauth2-2.2.1 spec/rack/oauth2/access_token/bearer_spec.rb
rack-oauth2-2.2.0 spec/rack/oauth2/access_token/bearer_spec.rb
rack-oauth2-2.1.0 spec/rack/oauth2/access_token/bearer_spec.rb
rack-oauth2-2.0.1 spec/rack/oauth2/access_token/bearer_spec.rb
rack-oauth2-2.0.0 spec/rack/oauth2/access_token/bearer_spec.rb
rack-oauth2-2.0.0.rc3 spec/rack/oauth2/access_token/bearer_spec.rb
rack-oauth2-2.0.0.rc2 spec/rack/oauth2/access_token/bearer_spec.rb
rack-oauth2-2.0.0.rc1 spec/rack/oauth2/access_token/bearer_spec.rb