diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/factories/projects.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/factories/projects.rb')
-rw-r--r-- | spec/factories/projects.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb index 84686c58a8e..fb86f4672bc 100644 --- a/spec/factories/projects.rb +++ b/spec/factories/projects.rb @@ -34,6 +34,7 @@ FactoryBot.define do end metrics_dashboard_access_level { ProjectFeature::PRIVATE } operations_access_level { ProjectFeature::ENABLED } + container_registry_access_level { ProjectFeature::ENABLED } # we can't assign the delegated `#ci_cd_settings` attributes directly, as the # `#ci_cd_settings` relation needs to be created first @@ -50,7 +51,7 @@ FactoryBot.define do ci_job_token_scope_enabled { nil } end - before(:create) do |project, evaluator| + after(:build) do |project, evaluator| # Builds and MRs can't have higher visibility level than repository access level. builds_access_level = [evaluator.builds_access_level, evaluator.repository_access_level].min merge_requests_access_level = [evaluator.merge_requests_access_level, evaluator.repository_access_level].min @@ -66,7 +67,8 @@ FactoryBot.define do pages_access_level: evaluator.pages_access_level, metrics_dashboard_access_level: evaluator.metrics_dashboard_access_level, operations_access_level: evaluator.operations_access_level, - analytics_access_level: evaluator.analytics_access_level + analytics_access_level: evaluator.analytics_access_level, + container_registry_access_level: evaluator.container_registry_access_level } project.build_project_feature(hash) @@ -263,7 +265,6 @@ FactoryBot.define do trait :remote_mirror do transient do - remote_name { "remote_mirror_#{SecureRandom.hex}" } url { "http://foo.com" } enabled { true } end @@ -344,6 +345,9 @@ FactoryBot.define do trait(:analytics_enabled) { analytics_access_level { ProjectFeature::ENABLED } } trait(:analytics_disabled) { analytics_access_level { ProjectFeature::DISABLED } } trait(:analytics_private) { analytics_access_level { ProjectFeature::PRIVATE } } + trait(:container_registry_enabled) { container_registry_access_level { ProjectFeature::ENABLED } } + trait(:container_registry_disabled) { container_registry_access_level { ProjectFeature::DISABLED } } + trait(:container_registry_private) { container_registry_access_level { ProjectFeature::PRIVATE } } trait :auto_devops do association :auto_devops, factory: :project_auto_devops |