Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-27 12:08:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-27 12:08:28 +0300
commit6ac4a6713ed3196af899011f7e18658e16ebaac0 (patch)
treec60237cb5203d171481b765d31bfead080d063cf /spec/policies
parentd2b64c37bdef067656fdc8deb4728a2fbc6c2729 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies')
-rw-r--r--spec/policies/note_policy_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/policies/note_policy_spec.rb b/spec/policies/note_policy_spec.rb
index 94e6a86025c..e9dd5ee1c51 100644
--- a/spec/policies/note_policy_spec.rb
+++ b/spec/policies/note_policy_spec.rb
@@ -263,6 +263,7 @@ describe NotePolicy do
let(:non_member) { create(:user) }
let(:author) { create(:user) }
let(:assignee) { create(:user) }
+ let(:admin) { create(:admin) }
before do
project.add_reporter(reporter)
@@ -294,6 +295,10 @@ describe NotePolicy do
expect(permissions(maintainer, confidential_note)).to be_allowed(:read_note, :admin_note, :resolve_note, :award_emoji)
end
+ it 'allows admins to read all notes and admin them' do
+ expect(permissions(admin, confidential_note)).to be_allowed(:read_note, :admin_note, :resolve_note, :award_emoji)
+ end
+
it 'allows noteable author to read and resolve all notes' do
expect(permissions(author, confidential_note)).to be_allowed(:read_note, :resolve_note, :award_emoji)
expect(permissions(author, confidential_note)).to be_disallowed(:admin_note)