diff options
Diffstat (limited to 'spec/policies/note_policy_spec.rb')
-rw-r--r-- | spec/policies/note_policy_spec.rb | 5 |
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) |