Skip to content

Commit

Permalink
DEV: Use dynamic/static fabricator attrs correctly (#9519)
Browse files Browse the repository at this point in the history
  • Loading branch information
CvX committed Apr 22, 2020
1 parent 00f632f commit 8adccaf
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion spec/fabricators/post_fabricator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

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
Expand Down
2 changes: 1 addition & 1 deletion spec/fabricators/topic_fabricator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
end

Fabricator(:deleted_topic, from: :topic) do
deleted_at Time.now
deleted_at { 1.minute.ago }
end

Fabricator(:closed_topic, from: :topic) do
Expand Down
2 changes: 1 addition & 1 deletion spec/fabricators/topic_timer_fabricator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions spec/fabricators/upload_fabricator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
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
Expand All @@ -67,7 +67,7 @@
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 changes: 1 addition & 1 deletion spec/fabricators/watched_word_fabricator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

Fabricator(:watched_word) do
word { sequence(:word) { |i| "word#{i}" } }
action { WatchedWord.actions[:block] }
action WatchedWord.actions[:block]
end
2 changes: 1 addition & 1 deletion spec/fabricators/web_crawler_request_fabricator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8adccaf

Please sign in to comment.