diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-19 15:04:47 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-19 15:04:47 -0400 |
commit | 22dd2240a6ec80955b98667c727326135a2f7f53 (patch) | |
tree | dc9870b22818c3e82be78368aa1e05f2981a2393 /spec/features/admin | |
parent | 6c8f0fe906d76cf27f22ffcd3475084f6e0398ec (diff) | |
download | gitlab-ce-22dd2240a6ec80955b98667c727326135a2f7f53.tar.gz |
Add 2FA status to Admin::Users#show
Diffstat (limited to 'spec/features/admin')
-rw-r--r-- | spec/features/admin/admin_users_spec.rb | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index f97b69713ce..7f5cb30cb94 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -63,15 +63,35 @@ describe "Admin::Users", feature: true do end describe "GET /admin/users/:id" do - before do + it "should have user info" do visit admin_users_path - click_link "#{@user.name}" - end + click_link @user.name - it "should have user info" do expect(page).to have_content(@user.email) expect(page).to have_content(@user.name) end + + describe 'Two-factor Authentication status' do + it 'shows when enabled' do + @user.update_attribute(:two_factor_enabled, true) + + visit admin_user_path(@user) + + expect_two_factor_status('Enabled') + end + + it 'shows when disabled' do + visit admin_user_path(@user) + + expect_two_factor_status('Disabled') + end + + def expect_two_factor_status(status) + page.within('.two-factor-status') do + expect(page).to have_content(status) + end + end + end end describe "GET /admin/users/:id/edit" do |