summaryrefslogtreecommitdiff
path: root/spec/features/admin
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-06-19 16:31:36 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-06-19 16:35:53 -0400
commit516b4c124831296a9280b9f04abcd865492eea1e (patch)
tree300022679679440235dc36576656e22ff470137b /spec/features/admin
parente13b523c92d82d10c553a90dd0fb93b73dee3023 (diff)
downloadgitlab-ce-516b4c124831296a9280b9f04abcd865492eea1e.tar.gz
Allow Admin to filter users by 2FA status
Diffstat (limited to 'spec/features/admin')
-rw-r--r--spec/features/admin/admin_users_spec.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb
index 7f5cb30cb94..86717761582 100644
--- a/spec/features/admin/admin_users_spec.rb
+++ b/spec/features/admin/admin_users_spec.rb
@@ -16,6 +16,46 @@ describe "Admin::Users", feature: true do
expect(page).to have_content(@user.email)
expect(page).to have_content(@user.name)
end
+
+ describe 'Two-factor Authentication filters' do
+ it 'counts users who have enabled 2FA' do
+ create(:user, two_factor_enabled: true)
+
+ visit admin_users_path
+
+ page.within('.filter-two-factor-enabled small') do
+ expect(page).to have_content('1')
+ end
+ end
+
+ it 'filters by users who have enabled 2FA' do
+ user = create(:user, two_factor_enabled: true)
+
+ visit admin_users_path
+ click_link '2FA Enabled'
+
+ expect(page).to have_content(user.email)
+ end
+
+ it 'counts users who have not enabled 2FA' do
+ create(:user, two_factor_enabled: false)
+
+ visit admin_users_path
+
+ page.within('.filter-two-factor-disabled small') do
+ expect(page).to have_content('2') # Including admin
+ end
+ end
+
+ it 'filters by users who have not enabled 2FA' do
+ user = create(:user, two_factor_enabled: false)
+
+ visit admin_users_path
+ click_link '2FA Disabled'
+
+ expect(page).to have_content(user.email)
+ end
+ end
end
describe "GET /admin/users/new" do