diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 21:09:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 21:09:21 +0300 |
commit | e0fa0638a422c3e20d4423c9bb69d79afc9c7d3d (patch) | |
tree | 9abb3c0706576bbda895fe9539a55556930606e2 /spec/factories | |
parent | f8d15ca65390475e356b06dedc51e10ccd179f86 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/ci/ref.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/factories/ci/ref.rb b/spec/factories/ci/ref.rb new file mode 100644 index 00000000000..891d8848a72 --- /dev/null +++ b/spec/factories/ci/ref.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :ci_ref, class: 'Ci::Ref' do + ref { 'master' } + status { :success } + tag { false } + project + + before(:create) do |ref, evaluator| + next if ref.pipelines.exists? + + ref.update!(last_updated_by_pipeline: create(:ci_pipeline, project: evaluator.project, ref: evaluator.ref, tag: evaluator.tag, status: evaluator.status)) + end + end +end |