1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
require 'helper'
describe OAuth2::Strategy::Implicit do
let(:client) { OAuth2::Client.new('abc', 'def', :site => 'http://api.example.com') }
subject { client.implicit }
describe '#authorize_url' do
it 'includes the client_id' do
expect(subject.authorize_url).to include('client_id=abc')
end
it 'includes the type' do
expect(subject.authorize_url).to include('response_type=token')
end
it 'includes passed in options' do
cb = 'http://myserver.local/oauth/callback'
expect(subject.authorize_url(:redirect_uri => cb)).to include("redirect_uri=#{Rack::Utils.escape(cb)}")
end
end
describe '#get_token' do
it 'raises NotImplementedError' do
expect { subject.get_token }.to raise_error(NotImplementedError)
end
end
end
|