diff options
Diffstat (limited to 'spec/features/users/active_sessions_spec.rb')
-rw-r--r-- | spec/features/users/active_sessions_spec.rb | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/spec/features/users/active_sessions_spec.rb b/spec/features/users/active_sessions_spec.rb index e2ee78a7cc5..53a4c8a91e9 100644 --- a/spec/features/users/active_sessions_spec.rb +++ b/spec/features/users/active_sessions_spec.rb @@ -2,27 +2,31 @@ require 'spec_helper' -RSpec.describe 'Active user sessions', :clean_gitlab_redis_sessions do +RSpec.describe 'Active user sessions', :clean_gitlab_redis_sessions, feature_category: :system_access do it 'successful login adds a new active user login' do + user = create(:user) + now = Time.zone.parse('2018-03-12 09:06') - Timecop.freeze(now) do - user = create(:user) + travel_to(now) do gitlab_sign_in(user) expect(page).to have_current_path root_path, ignore_query: true sessions = ActiveSession.list(user) expect(sessions.count).to eq 1 + gitlab_sign_out + end - # refresh the current page updates the updated_at - Timecop.freeze(now + 1.minute) do - visit current_path + # refresh the current page updates the updated_at + travel_to(now + 1.minute) do + gitlab_sign_in(user) + + visit current_path - sessions = ActiveSession.list(user) - expect(sessions.first).to have_attributes( - created_at: Time.zone.parse('2018-03-12 09:06'), - updated_at: Time.zone.parse('2018-03-12 09:07') - ) - end + sessions = ActiveSession.list(user) + expect(sessions.first).to have_attributes( + created_at: Time.zone.parse('2018-03-12 09:06'), + updated_at: Time.zone.parse('2018-03-12 09:07') + ) end end |