2019-11-18 22:21:57 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
2019-12-06 21:20:37 +08:00
|
|
|
factory :repository_date_time_value_base do
|
2019-11-18 22:21:57 +08:00
|
|
|
created_by { create :user }
|
|
|
|
last_modified_by { created_by }
|
2019-11-21 23:22:15 +08:00
|
|
|
data { Time.zone.now }
|
2019-12-06 21:20:37 +08:00
|
|
|
end
|
2019-11-18 22:21:57 +08:00
|
|
|
|
2019-12-06 21:20:37 +08:00
|
|
|
factory :repository_date_time_value, parent: :repository_date_time_value_base, class: 'RepositoryDateTimeValue' do
|
2019-11-18 22:21:57 +08:00
|
|
|
after(:build) do |value|
|
|
|
|
value.repository_cell ||= build(:repository_cell, :date_time_value, repository_date_time_value: value)
|
2020-02-17 07:26:20 +08:00
|
|
|
value.repository_cell.value = value
|
2019-11-18 22:21:57 +08:00
|
|
|
end
|
|
|
|
end
|
2019-12-08 23:53:59 +08:00
|
|
|
|
|
|
|
factory :repository_time_value, parent: :repository_date_time_value_base, class: 'RepositoryTimeValue' do
|
|
|
|
after(:build) do |value|
|
|
|
|
value.repository_cell ||= build(:repository_cell, :time_value, repository_time_value: value)
|
2020-02-17 07:26:20 +08:00
|
|
|
value.repository_cell.value = value
|
2019-12-08 23:53:59 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
factory :repository_date_value, parent: :repository_date_time_value_base, class: 'RepositoryDateValue' do
|
|
|
|
after(:build) do |value|
|
|
|
|
value.repository_cell ||= build(:repository_cell, :date_value, repository_date_value: value)
|
2020-02-17 07:26:20 +08:00
|
|
|
value.repository_cell.value = value
|
2019-12-08 23:53:59 +08:00
|
|
|
end
|
|
|
|
end
|
2019-11-18 22:21:57 +08:00
|
|
|
end
|