blob: 0e79f2e6d3a3e8dc94ce18fa97fed8d4bb54f185 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# frozen_string_literal: true
FactoryBot.define do
factory :release do
tag { "v1.1.0" }
sha { 'b83d6e391c22777fca1ed3012fce84f633d7fed0' }
name { tag }
description { "Awesome release" }
project
author
released_at { Time.zone.parse('2018-10-20T18:00:00Z') }
trait :legacy do
sha { nil }
author { nil }
end
trait :with_evidence do
after(:create) do |release, _|
create(:evidence, release: release)
end
end
trait :with_milestones do
transient do
milestones_count { 2 }
end
after(:create) do |release, evaluator|
create_list(:milestone, evaluator.milestones_count, project: evaluator.project, releases: [release])
end
end
end
end
|