Sha256: de9c40d5a1fc5ae54b9694e45275ae5879a8d35e07d7e47a5b2992bb949c0ff6
Contents?: true
Size: 685 Bytes
Versions: 40
Compression:
Stored size: 685 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 expect(request.header).to receive(:[]=).with('Authorization', 'OAuth access_token') token.authenticate(request) end end end
Version data entries
40 entries across 40 versions & 1 rubygems