scinote-web/spec/factories/repository_columns.rb

55 lines
1.1 KiB
Ruby
Raw Normal View History

2019-03-07 16:05:35 +08:00
# frozen_string_literal: true
FactoryBot.define do
2017-07-28 16:14:50 +08:00
factory :repository_column do
2019-03-07 16:05:35 +08:00
sequence(:name) { |n| "My column-#{n}" }
created_by { create :user }
repository
data_type { :RepositoryTextValue }
trait :text_type do
data_type { :RepositoryTextValue }
end
trait :list_type do
data_type { :RepositoryListValue }
end
trait :asset_type do
data_type { :RepositoryAssetValue }
end
trait :status_type do
data_type { :RepositoryStatusValue }
end
2019-11-18 22:21:57 +08:00
trait :date_time_type do
data_type { :RepositoryDateTimeValue }
end
trait :date_type do
data_type { :RepositoryDateValue }
end
trait :time_type do
data_type { :RepositoryTimeValue }
end
trait :date_time_range_type do
data_type { :RepositoryDateTimeRangeValue }
end
trait :date_range_type do
data_type { :RepositoryDateRangeValue }
end
trait :time_range_type do
data_type { :RepositoryTimeRangeValue }
2019-11-18 22:21:57 +08:00
end
2019-12-06 20:18:35 +08:00
2019-12-09 20:38:40 +08:00
trait :checklist_type do
data_type { :RepositoryChecklistValue }
2019-12-06 20:18:35 +08:00
end
2017-07-28 16:14:50 +08:00
end
end