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>2022-07-25 12:09:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-25 12:09:05 +0300
commit012ed4e4f69ab58f9d9b58140865a734fa5a9c88 (patch)
tree5ffb4f87d8b495a89662f0e5218c9dd3f4ae0f38 /spec/policies/work_item_policy_spec.rb
parent5b9a8005eaf815a0cae80a8482ff3f272d33e042 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies/work_item_policy_spec.rb')
-rw-r--r--spec/policies/work_item_policy_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/policies/work_item_policy_spec.rb b/spec/policies/work_item_policy_spec.rb
index f8ec7d9f9bc..f3e8bd6a08b 100644
--- a/spec/policies/work_item_policy_spec.rb
+++ b/spec/policies/work_item_policy_spec.rb
@@ -63,6 +63,27 @@ RSpec.describe WorkItemPolicy do
end
end
+ describe 'admin_work_item' do
+ context 'when user is reporter' do
+ let(:current_user) { reporter }
+
+ it { is_expected.to be_allowed(:admin_work_item) }
+ end
+
+ context 'when user is guest' do
+ let(:current_user) { guest }
+
+ it { is_expected.to be_disallowed(:admin_work_item) }
+
+ context 'when guest authored the work item' do
+ let(:work_item_subject) { authored_work_item }
+ let(:current_user) { guest_author }
+
+ it { is_expected.to be_disallowed(:admin_work_item) }
+ end
+ end
+ end
+
describe 'update_work_item' do
context 'when user is reporter' do
let(:current_user) { reporter }