Commit ab7c9033 authored by Toon Claes's avatar Toon Claes

Add :redis keyword to some specs clear state of trackable attributes

The specs that rely on a correct value of the trackable attributes, should
include the `:redis` keyword in the spec to ensure the state is reset between
various specs.

The trackable attributes being:

- sign_in_count      : Increased every time a sign in is made (by form, openid, oauth)
- current_sign_in_at : A timestamp updated when the user signs in
- last_sign_in_at    : Holds the timestamp of the previous sign in
- current_sign_in_ip : The remote ip updated when the user sign in
- last_sign_in_ip    : Holds the remote ip of the previous sign in

The limiting of writing trackable attributes was introduced in
gitlab-org/gitlab-ce!11053.
parent 561ec48c
......@@ -41,7 +41,7 @@ feature 'Login', feature: true do
expect(page).to have_content('Your account has been blocked.')
end
it 'does not update Devise trackable attributes' do
it 'does not update Devise trackable attributes', :redis do
user = create(:user, :blocked)
expect { login_with(user) }.not_to change { user.reload.sign_in_count }
......@@ -55,7 +55,7 @@ feature 'Login', feature: true do
expect(page).to have_content('Invalid Login or password.')
end
it 'does not update Devise trackable attributes' do
it 'does not update Devise trackable attributes', :redis do
expect { login_with(User.ghost) }.not_to change { User.ghost.reload.sign_in_count }
end
end
......
......@@ -68,7 +68,7 @@ feature 'Projects > Members > Sorting', feature: true do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, descending')
end
scenario 'sorts by recent sign in' do
scenario 'sorts by recent sign in', :redis do
visit_members_list(sort: :recent_sign_in)
expect(first_member).to include(master.name)
......@@ -76,7 +76,7 @@ feature 'Projects > Members > Sorting', feature: true do
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Recent sign in')
end
scenario 'sorts by oldest sign in' do
scenario 'sorts by oldest sign in', :redis do
visit_members_list(sort: :oldest_sign_in)
expect(first_member).to include(developer.name)
......
......@@ -98,7 +98,7 @@ describe 'OpenID Connect requests' do
expect(@payload['sub']).to eq hashed_subject
end
it 'includes the time of the last authentication' do
it 'includes the time of the last authentication', :redis do
expect(@payload['auth_time']).to eq user.current_sign_in_at.to_i
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment