mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 18:52:07 +08:00
30 lines
1.1 KiB
Ruby
30 lines
1.1 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
FactoryBot.define do
|
|
factory :repository_date_time_value_base do
|
|
created_by { create :user }
|
|
last_modified_by { created_by }
|
|
data { Time.zone.now }
|
|
end
|
|
|
|
factory :repository_date_time_value, parent: :repository_date_time_value_base, class: 'RepositoryDateTimeValue' do
|
|
after(:build) do |value|
|
|
value.repository_cell ||= build(:repository_cell, :date_time_value, repository_date_time_value: value)
|
|
value.repository_cell.value = value
|
|
end
|
|
end
|
|
|
|
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)
|
|
value.repository_cell.value = value
|
|
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)
|
|
value.repository_cell.value = value
|
|
end
|
|
end
|
|
end
|