Sha256: 294e79a0d13a69fdea6195c376604b339c87214d01e37be5d9d1c0b2bc2b6f23
Contents?: true
Size: 1.02 KB
Versions: 17
Compression:
Stored size: 1.02 KB
Contents
require 'spec_helper' describe FbGraph2::RequestFilter::Authenticator do let(:endpoint) { 'https://graph.facebook.com/matake' } let(:request) { HTTP::Message.new_request(:get, URI.parse(endpoint)) } let(:request_filter) { described_class.new token } context 'when String given' do let(:token) { 'token' } it do request_filter.filter_request(request) request.header["Authorization"].should == ["Bearer #{token}"] end end context 'when Rack::OAuth2::AccessToken::Bearer given' do let(:token) { Rack::OAuth2::AccessToken::Bearer.new access_token: 'token' } it do request_filter.filter_request(request) request.header["Authorization"].should == ["Bearer #{token.access_token}"] end end context 'when Rack::OAuth2::AccessToken::Legacy given' do let(:token) { Rack::OAuth2::AccessToken::Legacy.new access_token: 'token' } it do request_filter.filter_request(request) request.header["Authorization"].should == ["OAuth #{token.access_token}"] end end end
Version data entries
17 entries across 17 versions & 1 rubygems