mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 23:16:18 +08:00
25 lines
590 B
Ruby
25 lines
590 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
Fabricator(:bookmark) do
|
||
|
user
|
||
|
post { Fabricate(:post) }
|
||
|
topic nil
|
||
|
name "This looked interesting"
|
||
|
reminder_type { Bookmark.reminder_types[:tomorrow] }
|
||
|
reminder_at { (Time.now.utc + 1.day).iso8601 }
|
||
|
end
|
||
|
|
||
|
Fabricator(:bookmark_next_business_day_reminder, from: :bookmark) do
|
||
|
reminder_type { Bookmark.reminder_types[:next_business_day] }
|
||
|
reminder_at do
|
||
|
date = if Time.now.utc.friday?
|
||
|
Time.now.utc + 3.days
|
||
|
elsif Time.now.utc.saturday?
|
||
|
Time.now.utc + 2.days
|
||
|
else
|
||
|
Time.now.utc + 1.day
|
||
|
end
|
||
|
date.iso8601
|
||
|
end
|
||
|
end
|