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-05-15 18:08:04 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-15 18:08:04 +0300
commitc4c1fc5fe7c756fc6f8f79eb1624b1bbe4fe2d69 (patch)
tree8c95e39fc4956cdd9178c46ea85cbeeeac3bc360 /spec/policies/note_policy_spec.rb
parent927df95cc4453bdacbc59960df32008b02c4e28a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies/note_policy_spec.rb')
-rw-r--r--spec/policies/note_policy_spec.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/policies/note_policy_spec.rb b/spec/policies/note_policy_spec.rb
index e9dd5ee1c51..1e3bd0d9147 100644
--- a/spec/policies/note_policy_spec.rb
+++ b/spec/policies/note_policy_spec.rb
@@ -295,8 +295,16 @@ 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)
+ context 'when admin mode is enabled', :enable_admin_mode do
+ 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
+ end
+
+ context 'when admin mode is disabled' do
+ it 'does not allow non members to read confidential notes and replies' do
+ expect(permissions(admin, confidential_note)).to be_disallowed(:read_note, :admin_note, :resolve_note, :award_emoji)
+ end
end
it 'allows noteable author to read and resolve all notes' do