diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2018-05-03 15:38:55 +0200 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2018-05-03 15:38:55 +0200 |
commit | 794ac6c5421e04056dfd336559786fb166c9fa0a (patch) | |
tree | 0a7e5f89fd1ce8f1d88b220a05039899f3495ee0 /spec/factories/projects.rb | |
parent | 0ae300578139c0e71e8748b6106f673e4b3d19c8 (diff) | |
download | gitlab-ce-794ac6c5421e04056dfd336559786fb166c9fa0a.tar.gz |
Revert "Use factory in specs for ProjectCiCdSettings"
This reverts commit bf790c26c58e214c27132e7a54fdf4a4cc77bdaf.
Diffstat (limited to 'spec/factories/projects.rb')
-rw-r--r-- | spec/factories/projects.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb index e0e72e7f2ce..aed5eab8044 100644 --- a/spec/factories/projects.rb +++ b/spec/factories/projects.rb @@ -14,7 +14,6 @@ FactoryBot.define do # Associations namespace creator { group ? create(:user) : namespace&.owner } - ci_cd_settings strategy: :build, factory: :project_ci_cd_setting, project: nil transient do # Nest Project Feature attributes @@ -24,6 +23,10 @@ FactoryBot.define do issues_access_level ProjectFeature::ENABLED merge_requests_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 after(:create) do |project, evaluator| @@ -48,6 +51,9 @@ FactoryBot.define do end 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 trait :public do |