Sha256: 2443aae4c7f4d2afdbfb1d1d3c9f68b40dedcfcf953b9f41f85f8da7258b6f51
Contents?: true
Size: 1.12 KB
Versions: 11
Compression:
Stored size: 1.12 KB
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' } [:get, :delete].each do |method| before do fake_response(method, resource_endpoint, 'resources/fake.txt') end describe method.to_s.upcase do it 'should have Bearer Authorization header' do RestClient.should_receive(method).with( resource_endpoint, :AUTHORIZATION => 'Bearer access_token' ) token.send method, resource_endpoint end end end [:post, :put].each do |method| before do fake_response(method, resource_endpoint, 'resources/fake.txt') end describe method.to_s.upcase do it 'should have Bearer Authorization header' do RestClient.should_receive(method).with( resource_endpoint, {:key => :value}, {:AUTHORIZATION => 'Bearer access_token'} ) token.send method, resource_endpoint, {:key => :value} end end end end
Version data entries
11 entries across 11 versions & 1 rubygems