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>2023-03-10 06:08:23 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-10 06:08:23 +0300
commitd5954a6879517e10e80ffe9b2a200730a748e3ac (patch)
tree0c897d88ab5db4dadf2768e541a45669c2df22e7 /spec/policies
parent77edae8f143c25536a7539abb2be6935ebb2fddc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies')
-rw-r--r--spec/policies/project_policy_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/policies/project_policy_spec.rb b/spec/policies/project_policy_spec.rb
index 38c487f3c36..7b2b0122768 100644
--- a/spec/policies/project_policy_spec.rb
+++ b/spec/policies/project_policy_spec.rb
@@ -441,6 +441,36 @@ RSpec.describe ProjectPolicy, feature_category: :system_access do
end
end
+ context 'importing work items' do
+ %w(reporter developer maintainer owner).each do |role|
+ context "with #{role}" do
+ let(:current_user) { send(role) }
+
+ it { is_expected.to be_allowed(:import_work_items) }
+ end
+ end
+
+ %w(guest anonymous).each do |role|
+ context "with #{role}" do
+ let(:current_user) { send(role) }
+
+ it { is_expected.to be_disallowed(:import_work_items) }
+ end
+ end
+
+ context 'with an admin' do
+ let(:current_user) { admin }
+
+ context 'when admin mode is enabled', :enable_admin_mode do
+ it { expect_allowed(:import_work_items) }
+ end
+
+ context 'when admin mode is disabled' do
+ it { expect_disallowed(:import_work_items) }
+ end
+ end
+ end
+
context 'reading usage quotas' do
%w(maintainer owner).each do |role|
context "with #{role}" do