diff options
author | Kamil TrzciĆski <ayufan@ayufan.eu> | 2018-05-28 12:55:13 +0200 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2018-05-31 10:56:41 +0200 |
commit | 782337b3f204102ee82d9f40351f150350354a8c (patch) | |
tree | 3c70c556909d34304cc8b9b6e2623794b2cdb81e | |
parent | c6e95b04405f1e07f76505b03c6c096f4c4d084b (diff) | |
download | gitlab-ce-782337b3f204102ee82d9f40351f150350354a8c.tar.gz |
Fix traits of runners factories
-rw-r--r-- | spec/factories/ci/runners.rb | 8 |
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 |