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
e429aa0b
Commit
e429aa0b
authored
Jul 10, 2019
by
Eugenia Grieff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for admin_note in epic permissions
parent
37bea9fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
ee/spec/policies/epic_policy_spec.rb
ee/spec/policies/epic_policy_spec.rb
+25
-0
No files found.
ee/spec/policies/epic_policy_spec.rb
View file @
e429aa0b
...
...
@@ -16,6 +16,14 @@ describe EpicPolicy do
it
{
is_expected
.
to
be_disallowed
(
:create_note
,
:award_emoji
)
}
end
shared_examples
'can edit epic comments'
do
it
{
is_expected
.
to
be_allowed
(
:admin_note
)
}
end
shared_examples
'cannot edit epic comments'
do
it
{
is_expected
.
to
be_disallowed
(
:admin_note
)
}
end
shared_examples
'can only read epics'
do
it
do
is_expected
.
to
be_allowed
(
:read_epic
,
:read_epic_iid
)
...
...
@@ -39,6 +47,7 @@ describe EpicPolicy do
it_behaves_like
'can only read epics'
it_behaves_like
'can comment on epics'
it_behaves_like
'cannot edit epic comments'
end
context
'reporter group member'
do
...
...
@@ -48,6 +57,21 @@ describe EpicPolicy do
it_behaves_like
'can manage epics'
it_behaves_like
'can comment on epics'
it_behaves_like
'cannot edit epic comments'
it
'cannot destroy epics'
do
is_expected
.
to
be_disallowed
(
:destroy_epic
)
end
end
context
'group maintainer'
do
before
do
group
.
add_maintainer
(
user
)
end
it_behaves_like
'can manage epics'
it_behaves_like
'can comment on epics'
it_behaves_like
'can edit epic comments'
it
'cannot destroy epics'
do
is_expected
.
to
be_disallowed
(
:destroy_epic
)
...
...
@@ -61,6 +85,7 @@ describe EpicPolicy do
it_behaves_like
'can manage epics'
it_behaves_like
'can comment on epics'
it_behaves_like
'can edit epic comments'
it
'can destroy epics'
do
is_expected
.
to
be_allowed
(
:destroy_epic
)
...
...
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