Sha256: b76a46269837c288268763eb4e4d40613ae4804f9e15c6c83228769f8a4ed33e

Contents?: true

Size: 686 Bytes

Versions: 37

Compression:

Stored size: 686 Bytes

Contents

require 'spec_helper'

describe Rack::OAuth2::AccessToken::Legacy do
  let :token do
    Rack::OAuth2::AccessToken::Legacy.new(
      :access_token => 'access_token'
    )
  end
  let(:resource_endpoint) { 'https://server.example.com/resources/fake' }
  let(:request) { HTTPClient.new.send(:create_request, :post, URI.parse(resource_endpoint), {}, {:hello => "world"}, {}) }

  describe '#to_s' do
    subject { token }
    its(:to_s) { should == token.access_token }
  end

  describe '.authenticate' do
    it 'should set Authorization header' do
      request.header.should_receive(:[]=).with('Authorization', 'OAuth access_token')
      token.authenticate(request)
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
rack-oauth2-1.0.8 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-revibe-1.0.7 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-1.0.7 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-1.0.6 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-1.0.5 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-1.0.4 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-1.0.3 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-1.0.2 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-1.0.1 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-1.0.0 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-0.14.9 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-0.14.8 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-0.14.7 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-0.14.6 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-0.14.5 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-0.14.4 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-0.14.3 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-0.14.2 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-0.14.1 spec/rack/oauth2/access_token/legacy_spec.rb
rack-oauth2-0.14.0 spec/rack/oauth2/access_token/legacy_spec.rb