2019-03-12 15:49:56 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-01-23 21:54:15 +08:00
|
|
|
FactoryBot.define do
|
2017-07-28 16:14:50 +08:00
|
|
|
factory :repository_row do
|
2019-03-12 15:49:56 +08:00
|
|
|
sequence(:name) { |n| "My row-#{n}" }
|
|
|
|
created_by { create :user }
|
|
|
|
repository
|
|
|
|
last_modified_by { created_by }
|
2020-06-10 00:50:36 +08:00
|
|
|
|
|
|
|
trait :archived do
|
|
|
|
archived { true }
|
|
|
|
archived_on { Time.zone.now }
|
|
|
|
archived_by { created_by }
|
|
|
|
end
|
2020-06-23 14:24:52 +08:00
|
|
|
|
|
|
|
trait :restored do
|
|
|
|
archived { false }
|
|
|
|
restored_on { Time.zone.now }
|
|
|
|
restored_by { created_by }
|
|
|
|
end
|
2017-07-28 16:14:50 +08:00
|
|
|
end
|
|
|
|
end
|