DEV: Use dynamic/static fabricator attrs correctly (#9519)
This commit is contained in:
parent
00f632fb0d
commit
8adccaf98c
|
@ -20,7 +20,7 @@ end
|
|||
|
||||
Fabricator(:old_post, from: :post) do
|
||||
topic { |attrs| Fabricate(:topic, user: attrs[:user], created_at: (DateTime.now - 100)) }
|
||||
created_at (DateTime.now - 100)
|
||||
created_at { 100.days.ago }
|
||||
end
|
||||
|
||||
Fabricator(:moderator_post, from: :post) do
|
||||
|
|
|
@ -9,7 +9,7 @@ Fabricator(:topic) do
|
|||
end
|
||||
|
||||
Fabricator(:deleted_topic, from: :topic) do
|
||||
deleted_at Time.now
|
||||
deleted_at { 1.minute.ago }
|
||||
end
|
||||
|
||||
Fabricator(:closed_topic, from: :topic) do
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
Fabricator(:topic_timer) do
|
||||
user
|
||||
topic
|
||||
execute_at Time.zone.now + 1.hour
|
||||
execute_at { 1.hour.from_now }
|
||||
status_type TopicTimer.types[:close]
|
||||
end
|
||||
|
|
|
@ -45,7 +45,7 @@ Fabricator(:video_upload, from: :upload) do
|
|||
end
|
||||
|
||||
Fabricator(:secure_upload, from: :upload) do
|
||||
secure { true }
|
||||
secure true
|
||||
sha1 { SecureRandom.hex(20) }
|
||||
original_sha1 { sequence(:sha1) { |n| Digest::SHA1.hexdigest(n.to_s) } }
|
||||
end
|
||||
|
@ -67,7 +67,7 @@ Fabricator(:upload_s3, from: :upload) do
|
|||
end
|
||||
|
||||
Fabricator(:secure_upload_s3, from: :upload_s3) do
|
||||
secure { true }
|
||||
secure true
|
||||
sha1 { SecureRandom.hex(20) }
|
||||
original_sha1 { sequence(:sha1) { |n| Digest::SHA1.hexdigest(n.to_s) } }
|
||||
end
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
Fabricator(:watched_word) do
|
||||
word { sequence(:word) { |i| "word#{i}" } }
|
||||
action { WatchedWord.actions[:block] }
|
||||
action WatchedWord.actions[:block]
|
||||
end
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
Fabricator(:web_crawler_request) do
|
||||
user_agent { sequence(:ua) { |i| "Googlebot #{i}.0" } }
|
||||
date Time.zone.now.to_date
|
||||
date { Time.zone.now.to_date }
|
||||
count 0
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue