Sha256: e513301373dfe572419c358b4aee4648432cf0005e4e3c7639af471ffecafc35

Contents?: true

Size: 710 Bytes

Versions: 3

Compression:

Stored size: 710 Bytes

Contents

require 'test_helper'

class AuthControllerTest < ActiveSupport::IntegrationCase

  test 'auth entry point should not be accessable to logged OUT users' do
    visit oauth_new_path
    assert_equal '/users/sign_in', current_path
  end

  test 'auth entry point is accessable to logged IN users' do
    app           = create_client_app
    user          = create_user
    redirect_uri  = '/'

    as_user(user).visit oauth_new_path(:client_id => app.client_id, :redirect_uri => redirect_uri)

    assert_equal '/oauth/new', current_path

    click_button 'oauthAuthorize'
    assert_equal '/', current_path
    assert Oauth::AccessGrant.where(:user_id => user.id, :application_id => app.id).present?
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opro-0.0.1.pre1.0.2 test/integration/auth_controller_test.rb
opro-0.0.1.pre1.0.1 test/integration/auth_controller_test.rb
opro-0.0.1.pre test/integration/auth_controller_test.rb