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
2a1c2c67
Commit
2a1c2c67
authored
Feb 06, 2019
by
Roger Rüttimann
Committed by
Roger Meier
Jun 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for 2fa requirment for all sub-entities members (subgroup and projects)
parent
8bfc3a26
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
spec/models/group_spec.rb
spec/models/group_spec.rb
+24
-4
No files found.
spec/models/group_spec.rb
View file @
2a1c2c67
...
@@ -625,10 +625,7 @@ describe Group do
...
@@ -625,10 +625,7 @@ describe Group do
group
.
update!
(
description:
'foobar'
)
group
.
update!
(
description:
'foobar'
)
end
end
it
'calls #update_two_factor_requirement on each group member'
do
def
expects_other_user_to_require_two_factors
other_user
=
create
(
:user
)
group
.
add_user
(
other_user
,
GroupMember
::
OWNER
)
calls
=
0
calls
=
0
allow_any_instance_of
(
User
).
to
receive
(
:update_two_factor_requirement
)
do
allow_any_instance_of
(
User
).
to
receive
(
:update_two_factor_requirement
)
do
calls
+=
1
calls
+=
1
...
@@ -638,6 +635,29 @@ describe Group do
...
@@ -638,6 +635,29 @@ describe Group do
expect
(
calls
).
to
eq
2
expect
(
calls
).
to
eq
2
end
end
it
'calls #update_two_factor_requirement on each group member'
do
other_user
=
create
(
:user
)
group
.
add_user
(
other_user
,
GroupMember
::
OWNER
)
expects_other_user_to_require_two_factors
end
it
'calls #update_two_factor_requirement on each subgroup member'
do
subgroup
=
create
(
:group
,
:nested
,
parent:
group
)
subgroup_user
=
create
(
:user
)
subgroup
.
add_user
(
subgroup_user
,
GroupMember
::
OWNER
)
expects_other_user_to_require_two_factors
end
it
'calls #update_two_factor_requirement on each child project member'
do
project
=
create
(
:project
,
group:
group
)
project_user
=
create
(
:user
)
project
.
add_user
(
project_user
,
GroupMember
::
OWNER
)
expects_other_user_to_require_two_factors
end
end
end
describe
'#path_changed_hook'
do
describe
'#path_changed_hook'
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