A platform for community discussion. Free, open, simple.
DEV: Use dynamic/static fabricator attrs correctly (#9519)
Jarek Radosz8adccaf98c73
diff --git a/spec/fabricators/post_fabricator.rb b/spec/fabricators/post_fabricator.rbindex cd18b78967e..412504c7c4e 100644--- a/spec/fabricators/post_fabricator.rb+++ b/spec/fabricators/post_fabricator.rb@@ -20,7 +20,7 @@ endFabricator(:old_post, from: :post) dotopic { |attrs| Fabricate(:topic, user: attrs[:user], created_at: (DateTime.now - 100)) }- created_at (DateTime.now - 100)+ created_at { 100.days.ago }endFabricator(:moderator_post, from: :post) dodiff --git a/spec/fabricators/topic_fabricator.rb b/spec/fabricators/topic_fabricator.rbindex 8fc0307929e..3bcee07d2e7 100644--- a/spec/fabricators/topic_fabricator.rb+++ b/spec/fabricators/topic_fabricator.rb@@ -9,7 +9,7 @@ Fabricator(:topic) doendFabricator(:deleted_topic, from: :topic) do- deleted_at Time.now+ deleted_at { 1.minute.ago }endFabricator(:closed_topic, from: :topic) dodiff --git a/spec/fabricators/topic_timer_fabricator.rb b/spec/fabricators/topic_timer_fabricator.rbindex 99bacf7cb5f..56e3bbae131 100644--- a/spec/fabricators/topic_timer_fabricator.rb+++ b/spec/fabricators/topic_timer_fabricator.rb@@ -3,6 +3,6 @@Fabricator(:topic_timer) dousertopic- execute_at Time.zone.now + 1.hour+ execute_at { 1.hour.from_now }status_type TopicTimer.types[:close]enddiff --git a/spec/fabricators/upload_fabricator.rb b/spec/fabricators/upload_fabricator.rbindex 72bcb6c7232..c2f69527365 100644--- a/spec/fabricators/upload_fabricator.rb+++ b/spec/fabricators/upload_fabricator.rb@@ -45,7 +45,7 @@ Fabricator(:video_upload, from: :upload) doendFabricator(:secure_upload, from: :upload) do- secure { true }+ secure truesha1 { SecureRandom.hex(20) }original_sha1 { sequence(:sha1) { |n| Digest::SHA1.hexdigest(n.to_s) } }end@@ -67,7 +67,7 @@ Fabricator(:upload_s3, from: :upload) doendFabricator(:secure_upload_s3, from: :upload_s3) do- secure { true }+ secure truesha1 { SecureRandom.hex(20) }original_sha1 { sequence(:sha1) { |n| Digest::SHA1.hexdigest(n.to_s) } }enddiff --git a/spec/fabricators/watched_word_fabricator.rb b/spec/fabricators/watched_word_fabricator.rbindex b3796cad15b..521cb2fded6 100644--- a/spec/fabricators/watched_word_fabricator.rb+++ b/spec/fabricators/watched_word_fabricator.rb@@ -2,5 +2,5 @@Fabricator(:watched_word) doword { sequence(:word) { |i| "word#{i}" } }- action { WatchedWord.actions[:block] }+ action WatchedWord.actions[:block]enddiff --git a/spec/fabricators/web_crawler_request_fabricator.rb b/spec/fabricators/web_crawler_request_fabricator.rbindex 2d2be02fdf4..a20ab4225f0 100644--- a/spec/fabricators/web_crawler_request_fabricator.rb+++ b/spec/fabricators/web_crawler_request_fabricator.rb@@ -2,6 +2,6 @@Fabricator(:web_crawler_request) douser_agent { sequence(:ua) { |i| "Googlebot #{i}.0" } }- date Time.zone.now.to_date+ date { Time.zone.now.to_date }count 0end