Sha256: cea644194baaeda9b8c57615716f8be46f20194612fca0aa8aafa0b53e4486d1

Contents?: true

Size: 752 Bytes

Versions: 6

Compression:

Stored size: 752 Bytes

Contents

require 'spec_helper'
require 'support/features/feature_helpers'

feature 'visitor session time' do
  before do
    @user = create(:user)
    Authenticate.configuration.timeout_in = 10.minutes
  end

  scenario 'visitor logs in, subsequent click within timeout' do
    sign_in_with @user.email, @user.password
    expect_user_to_be_signed_in

    Timecop.travel 5.minutes do
      visit root_path
      expect_user_to_be_signed_in
    end
  end

  scenario 'visitor logs in, subsequent click after session times out' do
    sign_in_with @user.email, @user.password
    expect_user_to_be_signed_in

    Timecop.travel 11.minutes do
      visit root_path
      expect(current_path).to eq sign_in_path
      expect_user_to_be_signed_out
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
authenticate-0.7.1 spec/features/timeoutable_spec.rb
authenticate-0.7.0 spec/features/timeoutable_spec.rb
authenticate-0.6.1 spec/features/timeoutable_spec.rb
authenticate-0.6.0 spec/features/timeoutable_spec.rb
authenticate-0.5.0 spec/features/timeoutable_spec.rb
authenticate-0.4.0 spec/features/timeoutable_spec.rb