Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
22dd2240
Commit
22dd2240
authored
Jun 19, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 2FA status to Admin::Users#show
parent
6c8f0fe9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
4 deletions
+32
-4
app/views/admin/users/show.html.haml
app/views/admin/users/show.html.haml
+8
-0
spec/features/admin/admin_users_spec.rb
spec/features/admin/admin_users_spec.rb
+24
-4
No files found.
app/views/admin/users/show.html.haml
View file @
22dd2240
...
...
@@ -50,6 +50,14 @@
=
link_to
remove_email_admin_user_path
(
@user
,
email
),
data:
{
confirm:
"Are you sure you want to remove
#{
email
.
email
}
?"
},
method: :delete
,
class:
"btn-xs btn btn-remove pull-right"
,
title:
'Remove secondary email'
,
id:
"remove_email_
#{
email
.
id
}
"
do
%i
.fa.fa-times
%li
.two-factor-status
%span
.light
Two-factor Authentication:
%strong
{
class:
@user
.
two_factor_enabled?
?
'cgreen'
:
'cred'
}
-
if
@user
.
two_factor_enabled?
Enabled
-
else
Disabled
%li
%span
.light
Can create groups:
%strong
...
...
spec/features/admin/admin_users_spec.rb
View file @
22dd2240
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment