summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-16 12:09:17 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-16 12:09:17 +0000
commit09dff3eec735ccbe001d165293ecebf195452071 (patch)
tree03c73077d0703edb9452145e7109835da2cd4918 /spec/models
parent78e911431fc575ff4f6c9b7e0f95c02b57a5e926 (diff)
downloadgitlab-ce-09dff3eec735ccbe001d165293ecebf195452071.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/instance_configuration_spec.rb35
-rw-r--r--spec/models/project_feature_spec.rb2
-rw-r--r--spec/models/project_statistics_spec.rb6
3 files changed, 37 insertions, 6 deletions
diff --git a/spec/models/instance_configuration_spec.rb b/spec/models/instance_configuration_spec.rb
index 23068d5b76b..9544f0fe6ec 100644
--- a/spec/models/instance_configuration_spec.rb
+++ b/spec/models/instance_configuration_spec.rb
@@ -97,6 +97,41 @@ RSpec.describe InstanceConfiguration do
end
end
+ describe '#package_file_size_limits' do
+ let_it_be(:plan1) { create(:plan, name: 'plan1', title: 'Plan 1') }
+ let_it_be(:plan2) { create(:plan, name: 'plan2', title: 'Plan 2') }
+
+ before do
+ create(:plan_limits,
+ plan: plan1,
+ conan_max_file_size: 1001,
+ maven_max_file_size: 1002,
+ npm_max_file_size: 1003,
+ nuget_max_file_size: 1004,
+ pypi_max_file_size: 1005,
+ terraform_module_max_file_size: 1006,
+ generic_packages_max_file_size: 1007
+ )
+ create(:plan_limits,
+ plan: plan2,
+ conan_max_file_size: 1101,
+ maven_max_file_size: 1102,
+ npm_max_file_size: 1103,
+ nuget_max_file_size: 1104,
+ pypi_max_file_size: 1105,
+ terraform_module_max_file_size: 1106,
+ generic_packages_max_file_size: 1107
+ )
+ end
+
+ it 'returns package file size limits' do
+ file_size_limits = subject.settings[:package_file_size_limits]
+
+ expect(file_size_limits[:Plan1]).to eq({ conan: 1001, maven: 1002, npm: 1003, nuget: 1004, pypi: 1005, terraform_module: 1006, generic: 1007 })
+ expect(file_size_limits[:Plan2]).to eq({ conan: 1101, maven: 1102, npm: 1103, nuget: 1104, pypi: 1105, terraform_module: 1106, generic: 1107 })
+ end
+ end
+
describe '#rate_limits' do
before do
Gitlab::CurrentSettings.current_application_settings.update!(
diff --git a/spec/models/project_feature_spec.rb b/spec/models/project_feature_spec.rb
index 0e276191af1..5f720f8c4f8 100644
--- a/spec/models/project_feature_spec.rb
+++ b/spec/models/project_feature_spec.rb
@@ -8,6 +8,8 @@ RSpec.describe ProjectFeature do
let(:project) { create(:project) }
let(:user) { create(:user) }
+ it { is_expected.to belong_to(:project) }
+
describe 'PRIVATE_FEATURES_MIN_ACCESS_LEVEL_FOR_PRIVATE_PROJECT' do
it 'has higher level than that of PRIVATE_FEATURES_MIN_ACCESS_LEVEL' do
described_class::PRIVATE_FEATURES_MIN_ACCESS_LEVEL_FOR_PRIVATE_PROJECT.each do |feature, level|
diff --git a/spec/models/project_statistics_spec.rb b/spec/models/project_statistics_spec.rb
index cb1baa02e96..ba769e830fd 100644
--- a/spec/models/project_statistics_spec.rb
+++ b/spec/models/project_statistics_spec.rb
@@ -401,12 +401,6 @@ RSpec.describe ProjectStatistics do
let(:stat) { :build_artifacts_size }
it_behaves_like 'a statistic that increases storage_size asynchronously'
-
- it_behaves_like 'a statistic that increases storage_size' do
- before do
- stub_feature_flags(efficient_counter_attribute: false)
- end
- end
end
context 'when adjusting :pipeline_artifacts_size' do