DEV: Use dynamic/static fabricator attrs correctly (#9519)

This commit is contained in:
Jarek Radosz 2020-04-22 20:49:53 +02:00 committed by GitHub
parent 00f632fb0d
commit 8adccaf98c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -2,5 +2,5 @@
Fabricator(:watched_word) do
word { sequence(:word) { |i| "word#{i}" } }
action { WatchedWord.actions[:block] }
action WatchedWord.actions[:block]
end

View File

@ -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