diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-03-22 19:52:28 +0300 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-03-28 14:59:56 +0300 |
commit | 973e4030b13adbcc4eb7fad347b928a5164a04ff (patch) | |
tree | 2583fbd29dce1b6dde4b7a6b26525e7d27cf7d32 /spec/factories/ci | |
parent | 7d7b0688b846e346a0799340875d459d26c1718d (diff) |
Refactor build_metadata
Diffstat (limited to 'spec/factories/ci')
-rw-r--r-- | spec/factories/ci/build_metadata.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/factories/ci/build_metadata.rb b/spec/factories/ci/build_metadata.rb new file mode 100644 index 00000000000..66bbd977b88 --- /dev/null +++ b/spec/factories/ci/build_metadata.rb @@ -0,0 +1,9 @@ +FactoryBot.define do + factory :ci_build_metadata, class: Ci::BuildMetadata do + build factory: :ci_build + + after(:build) do |build_metadata, _| + build_metadata.project ||= build_metadata.build.project + end + end +end |