summaryrefslogtreecommitdiff
path: root/spec/features/login_spec.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2017-02-01 13:21:28 -0500
committerRobert Speicher <rspeicher@gmail.com>2017-02-10 11:51:14 -0500
commit191bcb4d1b5e983583e183d8945f638604c7f0e1 (patch)
tree98aa8d8ea8b6d8eb56158cde0127cbea630c610c /spec/features/login_spec.rb
parent4a9258371bf25ef0ce8687c3d7750d06b4337fe4 (diff)
downloadgitlab-ce-191bcb4d1b5e983583e183d8945f638604c7f0e1.tar.gz
Don't perform Devise trackable updates on blocked User recordsrs-warden-blocked-users
Diffstat (limited to 'spec/features/login_spec.rb')
-rw-r--r--spec/features/login_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/features/login_spec.rb b/spec/features/login_spec.rb
index ab7d89306db..ae609160e18 100644
--- a/spec/features/login_spec.rb
+++ b/spec/features/login_spec.rb
@@ -32,6 +32,22 @@ feature 'Login', feature: true do
end
end
+ describe 'with a blocked account' do
+ it 'prevents the user from logging in' do
+ user = create(:user, :blocked)
+
+ login_with(user)
+
+ expect(page).to have_content('Your account has been blocked.')
+ end
+
+ it 'does not update Devise trackable attributes' do
+ user = create(:user, :blocked)
+
+ expect { login_with(user) }.not_to change { user.reload.sign_in_count }
+ end
+ end
+
describe 'with two-factor authentication' do
def enter_code(code)
fill_in 'user_otp_attempt', with: code