Sha256: 7486dd099172783d3d9c6095784362e563a6a7018a887d9b6481e8920a6e3449

Contents?: true

Size: 770 Bytes

Versions: 15

Compression:

Stored size: 770 Bytes

Contents

require 'test_helper'

class CapybaraOauthTest < ActiveSupport::IntegrationCase

  test 'invalid auth_token should do nothing' do
    visit '/'
    assert has_content?('There be NO logged in users')
  end

  test 'valid auth token shows user as logged in' do
    user         = create_user
    auth_grant   = create_auth_grant_for_user(user)
    access_token = auth_grant.access_token
    visit "/?access_token=#{access_token}"
    assert has_content?('User is logged in')
  end

  test 'invalid auth token shows user as logged OUT' do
    user         = create_user
    auth_grant   = create_auth_grant_for_user(user)
    access_token = auth_grant.access_token + "foo"
    visit "/?access_token=#{access_token}"
    assert has_content?('NO logged in users')
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
opro-0.5.0 test/integration/oauth_test.rb
opro-0.4.3 test/integration/oauth_test.rb
opro-0.4.2 test/integration/oauth_test.rb
opro-0.4.1 test/integration/oauth_test.rb
opro-0.4.0 test/integration/oauth_test.rb
opro-0.3.3 test/integration/oauth_test.rb
opro-0.3.2 test/integration/oauth_test.rb
opro-0.3.1 test/integration/oauth_test.rb
opro-0.3.0 test/integration/oauth_test.rb
opro-0.3.0.pre3 test/integration/oauth_test.rb
opro-0.3.0.pre2 test/integration/oauth_test.rb
opro-0.3.0.pre1 test/integration/oauth_test.rb
opro-0.3.0.pre test/integration/oauth_test.rb
opro-0.2.1.pre test/integration/oauth_test.rb
opro-0.2.0 test/integration/oauth_test.rb