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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
e285fb50
Commit
e285fb50
authored
Mar 12, 2019
by
Małgorzata Ksionek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix false positive specs
parent
e4b2c3b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
spec/features/security/group/private_access_spec.rb
spec/features/security/group/private_access_spec.rb
+5
-1
spec/policies/group_policy_spec.rb
spec/policies/group_policy_spec.rb
+12
-2
No files found.
spec/features/security/group/private_access_spec.rb
View file @
e285fb50
...
...
@@ -96,16 +96,20 @@ describe 'Private Group access' do
describe
'GET /groups/:path for shared projects'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:linking_user
)
{
create
(
:user
)
}
before
do
group
.
add_guest
(
linking_user
)
Projects
::
GroupLinks
::
CreateService
.
new
(
project
,
create
(
:user
)
,
linking_user
,
link_group_access:
ProjectGroupLink
::
DEVELOPER
).
execute
(
group
)
end
subject
{
group_path
(
group
)
}
it
{
expect
(
group
.
shared_projects
).
not_to
be_empty
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
(
:maintainer
).
of
(
group
)
}
...
...
spec/policies/group_policy_spec.rb
View file @
e285fb50
...
...
@@ -80,6 +80,8 @@ describe GroupPolicy do
let
(
:current_user
)
{
nil
}
before
do
group
.
add_developer
(
user
)
Projects
::
GroupLinks
::
CreateService
.
new
(
project
,
user
,
...
...
@@ -87,7 +89,10 @@ describe GroupPolicy do
).
execute
(
group
)
end
it
{
expect_disallowed
(
:read_group
)
}
it
do
expect
(
group
.
shared_projects
).
not_to
be_empty
expect_disallowed
(
:read_group
)
end
end
context
'with foreign user and public project'
do
...
...
@@ -96,6 +101,8 @@ describe GroupPolicy do
let
(
:current_user
)
{
create
(
:user
)
}
before
do
group
.
add_developer
(
user
)
Projects
::
GroupLinks
::
CreateService
.
new
(
project
,
user
,
...
...
@@ -103,7 +110,10 @@ describe GroupPolicy do
).
execute
(
group
)
end
it
{
expect_disallowed
(
:read_group
)
}
it
do
expect
(
group
.
shared_projects
).
not_to
be_empty
expect_disallowed
(
:read_group
)
end
end
context
'has projects'
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