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
bd0b030b
Commit
bd0b030b
authored
Jan 16, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add regression tests for internal and private groups
parent
c4203653
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
spec/policies/group_member_policy_spec.rb
spec/policies/group_member_policy_spec.rb
+30
-1
No files found.
spec/policies/group_member_policy_spec.rb
View file @
bd0b030b
...
...
@@ -3,6 +3,8 @@
require
'spec_helper'
RSpec
.
describe
GroupMemberPolicy
do
include
DesignManagementTestHelpers
let
(
:guest
)
{
create
(
:user
)
}
let
(
:owner
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
,
:private
)
}
...
...
@@ -34,9 +36,36 @@ RSpec.describe GroupMemberPolicy do
let
(
:membership
)
{
guest
.
members
.
first
}
it
do
expect_disallowed
(
*
member_related_permissions
)
expect_disallowed
(
:read_design_activity
,
*
member_related_permissions
)
expect_allowed
(
:read_group
)
end
context
'design management is enabled'
do
before
do
create
(
:project
,
:public
,
group:
group
)
# Necessary to enable design management
enable_design_management
end
specify
do
expect_allowed
(
:read_design_activity
)
end
end
context
'for a private group'
do
let
(
:group
)
{
create
(
:group
,
:private
)
}
specify
do
expect_disallowed
(
:read_group
,
*
member_related_permissions
)
end
end
context
'for an internal group'
do
let
(
:group
)
{
create
(
:group
,
:internal
)
}
specify
do
expect_disallowed
(
:read_group
,
*
member_related_permissions
)
end
end
end
context
'with guest user, for own membership'
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