summaryrefslogtreecommitdiff
path: root/spec/policies
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-14 15:06:07 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-14 15:06:07 +0000
commit429d1abad29d379d8bc8f5219eb72384ad485deb (patch)
tree5c8f9c96c203dbeb3e3e89f3979ce60453340f3f /spec/policies
parente464f195ff5debc3e9aad0f8c4537404b92019c6 (diff)
downloadgitlab-ce-429d1abad29d379d8bc8f5219eb72384ad485deb.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies')
-rw-r--r--spec/policies/group_policy_spec.rb24
-rw-r--r--spec/policies/project_policy_spec.rb24
2 files changed, 48 insertions, 0 deletions
diff --git a/spec/policies/group_policy_spec.rb b/spec/policies/group_policy_spec.rb
index 02bcc716bee..603e7e874c9 100644
--- a/spec/policies/group_policy_spec.rb
+++ b/spec/policies/group_policy_spec.rb
@@ -547,4 +547,28 @@ describe GroupPolicy do
groups: [clusterable])
end
end
+
+ describe 'update_max_artifacts_size' do
+ let(:group) { create(:group, :public) }
+
+ context 'when no user' do
+ let(:current_user) { nil }
+
+ it { expect_disallowed(:update_max_artifacts_size) }
+ end
+
+ context 'admin' do
+ let(:current_user) { admin }
+
+ it { expect_allowed(:update_max_artifacts_size) }
+ end
+
+ %w(guest reporter developer maintainer owner).each do |role|
+ context role do
+ let(:current_user) { send(role) }
+
+ it { expect_disallowed(:update_max_artifacts_size) }
+ end
+ end
+ end
end
diff --git a/spec/policies/project_policy_spec.rb b/spec/policies/project_policy_spec.rb
index 71ba73d5661..6093464c949 100644
--- a/spec/policies/project_policy_spec.rb
+++ b/spec/policies/project_policy_spec.rb
@@ -478,4 +478,28 @@ describe ProjectPolicy do
end
end
end
+
+ describe 'update_max_artifacts_size' do
+ subject { described_class.new(current_user, project) }
+
+ context 'when no user' do
+ let(:current_user) { nil }
+
+ it { expect_disallowed(:update_max_artifacts_size) }
+ end
+
+ context 'admin' do
+ let(:current_user) { admin }
+
+ it { expect_allowed(:update_max_artifacts_size) }
+ end
+
+ %w(guest reporter developer maintainer owner).each do |role|
+ context role do
+ let(:current_user) { send(role) }
+
+ it { expect_disallowed(:update_max_artifacts_size) }
+ end
+ end
+ end
end