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
03fa7834
Commit
03fa7834
authored
Mar 13, 2019
by
Małgorzata Ksionek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cr remarks
parent
e285fb50
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
32 deletions
+5
-32
spec/features/security/group/private_access_spec.rb
spec/features/security/group/private_access_spec.rb
+1
-9
spec/policies/group_policy_spec.rb
spec/policies/group_policy_spec.rb
+4
-23
No files found.
spec/features/security/group/private_access_spec.rb
View file @
03fa7834
...
@@ -96,20 +96,12 @@ describe 'Private Group access' do
...
@@ -96,20 +96,12 @@ describe 'Private Group access' do
describe
'GET /groups/:path for shared projects'
do
describe
'GET /groups/:path for shared projects'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:linking_user
)
{
create
(
:user
)
}
before
do
before
do
group
.
add_guest
(
linking_user
)
create
(
:project_group_link
,
project:
project
,
group:
group
)
Projects
::
GroupLinks
::
CreateService
.
new
(
project
,
linking_user
,
link_group_access:
ProjectGroupLink
::
DEVELOPER
).
execute
(
group
)
end
end
subject
{
group_path
(
group
)
}
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
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
(
:maintainer
).
of
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
(
:maintainer
).
of
(
group
)
}
...
...
spec/policies/group_policy_spec.rb
View file @
03fa7834
...
@@ -76,23 +76,13 @@ describe GroupPolicy do
...
@@ -76,23 +76,13 @@ describe GroupPolicy do
context
'with no user and public project'
do
context
'with no user and public project'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:current_user
)
{
nil
}
let
(
:current_user
)
{
nil
}
before
do
before
do
group
.
add_developer
(
user
)
create
(
:project_group_link
,
project:
project
,
group:
group
)
Projects
::
GroupLinks
::
CreateService
.
new
(
project
,
user
,
link_group_access:
ProjectGroupLink
::
DEVELOPER
).
execute
(
group
)
end
end
it
do
it
{
expect_disallowed
(
:read_group
)
}
expect
(
group
.
shared_projects
).
not_to
be_empty
expect_disallowed
(
:read_group
)
end
end
end
context
'with foreign user and public project'
do
context
'with foreign user and public project'
do
...
@@ -101,19 +91,10 @@ describe GroupPolicy do
...
@@ -101,19 +91,10 @@ describe GroupPolicy do
let
(
:current_user
)
{
create
(
:user
)
}
let
(
:current_user
)
{
create
(
:user
)
}
before
do
before
do
group
.
add_developer
(
user
)
create
(
:project_group_link
,
project:
project
,
group:
group
)
Projects
::
GroupLinks
::
CreateService
.
new
(
project
,
user
,
link_group_access:
ProjectGroupLink
::
DEVELOPER
).
execute
(
group
)
end
end
it
do
it
{
expect_disallowed
(
:read_group
)
}
expect
(
group
.
shared_projects
).
not_to
be_empty
expect_disallowed
(
:read_group
)
end
end
end
context
'has projects'
do
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