2019-01-25 21:53:06 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :system_notification do
|
|
|
|
sequence(:title) { |n| "System notification #{n}" }
|
2019-02-20 23:05:15 +08:00
|
|
|
description { Faker::ChuckNorris.fact[0..255] }
|
2019-01-25 21:53:06 +08:00
|
|
|
modal_title { Faker::Name.first_name }
|
2019-09-12 23:21:48 +08:00
|
|
|
modal_body { Faker::Lorem.paragraphs(number: 4).map { |pr| "<p>#{pr}</p>" }.join }
|
|
|
|
source_created_at { Faker::Time.between(from: 3.days.ago, to: Date.today) }
|
2019-04-25 14:54:50 +08:00
|
|
|
source_id { SystemNotification.order(source_id: :desc).first&.source_id.to_i + 1 }
|
2019-01-31 15:53:02 +08:00
|
|
|
last_time_changed_at { Time.now }
|
2019-01-25 21:53:06 +08:00
|
|
|
trait :show_on_login do
|
|
|
|
show_on_login { true }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|