Revert "Use factory in specs for ProjectCiCdSettings"
This reverts commit bf790c26c5
.
This commit is contained in:
parent
0ae3005781
commit
794ac6c542
|
@ -1,10 +0,0 @@
|
||||||
FactoryBot.define do
|
|
||||||
factory :project_ci_cd_setting do
|
|
||||||
project
|
|
||||||
|
|
||||||
initialize_with do
|
|
||||||
# ci_cd_settings are automatically created when a project is created
|
|
||||||
project&.ci_cd_settings || new
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -14,7 +14,6 @@ FactoryBot.define do
|
||||||
# Associations
|
# Associations
|
||||||
namespace
|
namespace
|
||||||
creator { group ? create(:user) : namespace&.owner }
|
creator { group ? create(:user) : namespace&.owner }
|
||||||
ci_cd_settings strategy: :build, factory: :project_ci_cd_setting, project: nil
|
|
||||||
|
|
||||||
transient do
|
transient do
|
||||||
# Nest Project Feature attributes
|
# Nest Project Feature attributes
|
||||||
|
@ -24,6 +23,10 @@ FactoryBot.define do
|
||||||
issues_access_level ProjectFeature::ENABLED
|
issues_access_level ProjectFeature::ENABLED
|
||||||
merge_requests_access_level ProjectFeature::ENABLED
|
merge_requests_access_level ProjectFeature::ENABLED
|
||||||
repository_access_level ProjectFeature::ENABLED
|
repository_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
|
||||||
|
group_runners_enabled nil
|
||||||
end
|
end
|
||||||
|
|
||||||
after(:create) do |project, evaluator|
|
after(:create) do |project, evaluator|
|
||||||
|
@ -48,6 +51,9 @@ FactoryBot.define do
|
||||||
end
|
end
|
||||||
|
|
||||||
project.group&.refresh_members_authorized_projects
|
project.group&.refresh_members_authorized_projects
|
||||||
|
|
||||||
|
# assign the delegated `#ci_cd_settings` attributes after create
|
||||||
|
project.reload.group_runners_enabled = evaluator.group_runners_enabled unless evaluator.group_runners_enabled.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
trait :public do
|
trait :public do
|
||||||
|
|
Loading…
Reference in New Issue