Sha256: 9d9607e61c8c4990acad501aaa3944e0d37e74ffbfeae6af57f01803396c1e0e
Contents?: true
Size: 690 Bytes
Versions: 4
Compression:
Stored size: 690 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
4 entries across 4 versions & 1 rubygems