Sha256: 9af55455e2539f210b27097558f96fe14c8e5f5c6b6d48940083b0a8323a64bd

Contents?: true

Size: 1.19 KB

Versions: 13

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

describe Devise::Oauth2::AuthorizationsController do
  describe 'GET #new' do
    context 'with valid redirect_uri' do
      with :user
      with :client
      let(:redirect_uri) { client.redirect_uri }
      before do
        sign_in user
        get :new, :client_id => client.identifier, :redirect_uri => redirect_uri, :response_type => 'code', :use_route => 'devise_oauth2_providable'
      end
      it { should respond_with :ok }
      it { should respond_with_content_type :html }
      it { should assign_to(:redirect_uri).with(redirect_uri) }
      it { should assign_to(:response_type) }
      it { should render_template 'devise/oauth2_providable/authorizations/new' }
      it { should render_with_layout 'application' }
    end
    context 'with invalid redirect_uri' do
      with :user
      with :client
      let(:redirect_uri) { 'http://example.com/foo/bar' }
      before do
        sign_in user
        get :new, :client_id => client.identifier, :redirect_uri => redirect_uri, :response_type => 'code', :use_route => 'devise_oauth2_providable'
      end
      it { should respond_with :bad_request }
      it { should respond_with_content_type :html }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
devise_oauth2_rails4-2.1.4 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-2.1.3 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-2.0.3 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-2.1.0 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-2.0.2 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-2.0.1 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-2.0.0 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-1.1.8 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-1.1.7 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-1.1.6 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-1.1.5 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-1.1.4 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-1.1.3 spec/controllers/authorizations_controller_spec.rb