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 }
|
|
|
|
end
|
2023-05-03 21:55:36 +08:00
|
|
|
|
|
|
|
trait :in_repository_draft do
|
|
|
|
my_module { nil }
|
|
|
|
protocol_type { :in_repository_draft }
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :in_repository_published_original do
|
|
|
|
my_module { nil }
|
|
|
|
protocol_type { :in_repository_published_original }
|
|
|
|
version_number { 1 }
|
|
|
|
published_on { Time.now }
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :in_repository_published_version do
|
|
|
|
my_module { nil }
|
|
|
|
protocol_type { :in_repository_published_version }
|
|
|
|
published_on { Time.now }
|
|
|
|
end
|
2018-10-15 22:27:22 +08:00
|
|
|
end
|
|
|
|
end
|