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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0871d6c2
Commit
0871d6c2
authored
Feb 23, 2021
by
peterhegman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for admin 2FA badge visibility
parent
c882d163
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
spec/features/groups/members/list_members_spec.rb
spec/features/groups/members/list_members_spec.rb
+10
-0
spec/features/projects/members/list_spec.rb
spec/features/projects/members/list_spec.rb
+11
-1
No files found.
spec/features/groups/members/list_members_spec.rb
View file @
0871d6c2
...
...
@@ -49,6 +49,7 @@ RSpec.describe 'Groups > Members > List members', :js do
end
describe
'when user has 2FA enabled'
do
let_it_be
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:user_with_2fa
)
{
create
(
:user
,
:two_factor_via_otp
)
}
before
do
...
...
@@ -63,6 +64,15 @@ RSpec.describe 'Groups > Members > List members', :js do
expect
(
find_member_row
(
user_with_2fa
)).
to
have_content
(
'2FA'
)
end
it
'shows 2FA badge to admins'
do
sign_in
(
admin
)
gitlab_enable_admin_mode_sign_in
(
admin
)
visit
group_group_members_path
(
group
)
expect
(
find_member_row
(
user_with_2fa
)).
to
have_content
(
'2FA'
)
end
it
'does not show 2FA badge to users with access level below "Owner"'
do
group
.
add_maintainer
(
user1
)
...
...
spec/features/projects/members/list_spec.rb
View file @
0871d6c2
...
...
@@ -8,7 +8,7 @@ RSpec.describe 'Project members list' do
let
(
:user1
)
{
create
(
:user
,
name:
'John Doe'
)
}
let
(
:user2
)
{
create
(
:user
,
name:
'Mary Jane'
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let
(
:project
)
{
create
(
:project
,
:internal
,
namespace:
group
)
}
before
do
stub_feature_flags
(
invite_members_group_modal:
false
)
...
...
@@ -119,6 +119,7 @@ RSpec.describe 'Project members list' do
end
describe
'when user has 2FA enabled'
do
let_it_be
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:user_with_2fa
)
{
create
(
:user
,
:two_factor_via_otp
)
}
before
do
...
...
@@ -133,6 +134,15 @@ RSpec.describe 'Project members list' do
expect
(
find_member_row
(
user_with_2fa
)).
to
have_content
(
'2FA'
)
end
it
'shows 2FA badge to admins'
do
sign_in
(
admin
)
gitlab_enable_admin_mode_sign_in
(
admin
)
visit_members_page
expect
(
find_member_row
(
user_with_2fa
)).
to
have_content
(
'2FA'
)
end
it
'does not show 2FA badge to users with access level below "Maintainer"'
do
group
.
add_developer
(
user1
)
...
...
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