File: implicit_spec.rb

package info (click to toggle)
ruby-oauth2 0.9.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 236 kB
  • ctags: 84
  • sloc: ruby: 1,072; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 793 bytes parent folder | download | duplicates (2)
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