Sha256: 1ca8af59a26bd1d361034439e4f8f1938bf9738175d84d5f9c136cc97cdde1ef

Contents?: true

Size: 699 Bytes

Versions: 2

Compression:

Stored size: 699 Bytes

Contents

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

feature 'visitor session time' do
  before do
    @user = create(:user)
  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 10.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 21.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

2 entries across 2 versions & 1 rubygems

Version Path
authenticate-0.3.1 spec/features/timeoutable_spec.rb
authenticate-0.3.0 spec/features/timeoutable_spec.rb