Sha256: f736c2aac0a69321f8eaa9e3b502966bf3ecb04526b455912be2ed51dd657855

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 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 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_rails4'
      end
      it { should respond_with :bad_request }
      #it { should respond_with_content_type :html }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
devise_oauth2_rails4-2.1.8 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-2.1.7 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-2.1.6 spec/controllers/authorizations_controller_spec.rb
devise_oauth2_rails4-2.1.5 spec/controllers/authorizations_controller_spec.rb