Sha256: ed3634044d34ab694447d5fe94b95f31be46630e00a144761fb4a19e7c14731a

Contents?: true

Size: 768 Bytes

Versions: 18

Compression:

Stored size: 768 Bytes

Contents

require 'test_helper'

class CapybaraRefreshTokenTest < ActiveSupport::IntegrationCase

  setup do
    Timecop.freeze(Time.now)
    Opro.setup do |config|
      config.require_refresh_within = 1.month
    end

    @user         = create_user
    @auth_grant   = create_auth_grant_for_user(@user)
    @client_app   = @auth_grant.application
  end

  teardown do
    Timecop.return # "turn off" Timecop
  end

  test "clients with an expired token do not get logged in" do
    user         = create_user
    auth_grant   = create_auth_grant_for_user(user)
    access_token = auth_grant.access_token

    Timecop.travel(5.months.from_now)
    visit "/?access_token=#{access_token}"

    assert has_content?('NO logged in users')
    assert auth_grant.expired?
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

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