Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil TrzciƄski <ayufan@ayufan.eu>2018-05-28 13:55:13 +0300
committerDylan Griffith <dyl.griffith@gmail.com>2018-05-31 11:56:41 +0300
commit782337b3f204102ee82d9f40351f150350354a8c (patch)
tree3c70c556909d34304cc8b9b6e2623794b2cdb81e /spec/factories/ci
parentc6e95b04405f1e07f76505b03c6c096f4c4d084b (diff)
Fix traits of runners factories
Diffstat (limited to 'spec/factories/ci')
-rw-r--r--spec/factories/ci/runners.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/factories/ci/runners.rb b/spec/factories/ci/runners.rb
index e9bbb9f36e8..c698b74c578 100644
--- a/spec/factories/ci/runners.rb
+++ b/spec/factories/ci/runners.rb
@@ -21,11 +21,19 @@ FactoryBot.define do
trait :group do
is_shared false
runner_type :group_type
+
+ after(:build) do |runner, evaluator|
+ runner.groups << build(:group) if runner.groups.empty?
+ end
end
trait :project do
is_shared false
runner_type :project_type
+
+ after(:build) do |runner, evaluator|
+ runner.projects << build(:project) if runner.projects.empty?
+ end
end
trait :inactive do