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:
Diffstat (limited to 'spec/factories/ci/builds.rb')
-rw-r--r--spec/factories/ci/builds.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb
index 56c12d73a3b..97ddbf21b99 100644
--- a/spec/factories/ci/builds.rb
+++ b/spec/factories/ci/builds.rb
@@ -33,6 +33,18 @@ FactoryBot.define do
name { generate(:job_name) }
end
+ trait :matrix do
+ sequence(:name) { |n| "job: [#{n}]" }
+ options do
+ {
+ parallel: {
+ total: 2,
+ matrix: [{ ID: %w[1 2] }]
+ }
+ }
+ end
+ end
+
trait :dependent do
scheduling_type { 'dag' }
@@ -494,13 +506,15 @@ FactoryBot.define do
trait :with_commit do
after(:build) do |build|
- allow(build).to receive(:commit).and_return build(:commit, :without_author)
+ commit = build(:commit, :without_author)
+ stub_method(build, :commit) { commit }
end
end
trait :with_commit_and_author do
after(:build) do |build|
- allow(build).to receive(:commit).and_return build(:commit)
+ commit = build(:commit)
+ stub_method(build, :commit) { commit }
end
end