summaryrefslogtreecommitdiff
path: root/spec/policies
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-27 10:15:59 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-27 10:16:27 +0000
commiteff560cfb9a337623d25b912d9bb233fae25fbf1 (patch)
treedd96ba1b42ddc1cdc588c0ff4096a4d47d0b5e0d /spec/policies
parent14b92217e768aa4f3ce2d8b30f2c2acbdfdd8f6a (diff)
downloadgitlab-ce-eff560cfb9a337623d25b912d9bb233fae25fbf1.tar.gz
Add latest changes from gitlab-org/security/gitlab@14-4-stable-ee
Diffstat (limited to 'spec/policies')
-rw-r--r--spec/policies/issuable_policy_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/policies/issuable_policy_spec.rb b/spec/policies/issuable_policy_spec.rb
index 86b04ccda57..eeb298e853e 100644
--- a/spec/policies/issuable_policy_spec.rb
+++ b/spec/policies/issuable_policy_spec.rb
@@ -13,6 +13,10 @@ RSpec.describe IssuablePolicy, models: true do
let(:merge_request) { create(:merge_request, source_project: project, author: user) }
let(:policies) { described_class.new(user, merge_request) }
+ it 'allows resolving notes' do
+ expect(policies).to be_allowed(:resolve_note)
+ end
+
context 'when user is able to read project' do
it 'enables user to read and update issuables' do
expect(policies).to be_allowed(:read_issue, :update_issue, :reopen_issue, :read_merge_request, :update_merge_request, :reopen_merge_request)
@@ -43,16 +47,24 @@ RSpec.describe IssuablePolicy, models: true do
it 'can not create a note nor award emojis' do
expect(policies).to be_disallowed(:create_note, :award_emoji)
end
+
+ it 'does not allow resolving note' do
+ expect(policies).to be_disallowed(:resolve_note)
+ end
end
context 'when the user is a project member' do
before do
- project.add_guest(user)
+ project.add_developer(user)
end
it 'can create a note and award emojis' do
expect(policies).to be_allowed(:create_note, :award_emoji)
end
+
+ it 'allows resolving notes' do
+ expect(policies).to be_allowed(:resolve_note)
+ end
end
end
end