2018-10-15 22:27:22 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
2019-02-28 21:01:58 +08:00
|
|
|
factory :protocol do
|
2018-10-15 22:27:22 +08:00
|
|
|
name { Faker::Name.unique.name }
|
2019-02-28 21:01:58 +08:00
|
|
|
team
|
|
|
|
my_module
|
2019-03-08 17:57:09 +08:00
|
|
|
trait :in_public_repository do
|
|
|
|
my_module { nil }
|
|
|
|
protocol_type { :in_repository_public }
|
|
|
|
added_by { create :user }
|
|
|
|
published_on { Time.now }
|
|
|
|
end
|
2019-03-27 18:24:44 +08:00
|
|
|
trait :linked_to_repository do
|
|
|
|
protocol_type { :linked }
|
|
|
|
parent { create :protocol }
|
|
|
|
added_by { create :user }
|
|
|
|
parent_updated_at { Time.now }
|
|
|
|
end
|
2018-10-15 22:27:22 +08:00
|
|
|
end
|
|
|
|
end
|