Sha256: 3ee61ce309cf66ecb399034ff05e3936c9afc69a5d9949167a91c187cd698154

Contents?: true

Size: 896 Bytes

Versions: 35

Compression:

Stored size: 896 Bytes

Contents

require 'spec_helper.rb'

describe Rack::OAuth2::Server::Authorize::Code do
  let(:request) { Rack::MockRequest.new app }
  let(:redirect_uri)   { 'http://client.example.com/callback' }
  let(:response_mode)  { 'form_post' }
  subject { @request }

  describe 'authorization request' do
    let :app do
      Rack::OAuth2::Server::Authorize.new do |request, response|
        @request = request
      end
    end

    context 'when response_mode is given' do
      before do
        request.get "/?response_type=code&client_id=client&redirect_uri=#{redirect_uri}&state=state&response_mode=#{response_mode}"
      end
      its(:response_mode) { should == response_mode }
    end

    context 'otherwise' do
      before do
        request.get "/?response_type=code&client_id=client&redirect_uri=#{redirect_uri}&state=state"
      end
      its(:response_mode) { should == nil }
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
rack-oauth2-2.2.1 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-2.2.0 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-2.1.0 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-2.0.1 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-2.0.0 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-2.0.0.rc3 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-2.0.0.rc2 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-2.0.0.rc1 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-1.21.3 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-1.21.2 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-1.21.1 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-1.21.0 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-1.20.0 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-1.19.0 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-1.18.0 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-1.17.0 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-1.16.0 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-1.15.0 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-1.14.0 spec/rack/oauth2/server/extension/response_mode_spec.rb
rack-oauth2-1.13.0 spec/rack/oauth2/server/extension/response_mode_spec.rb