Skip to content

A platform for community discussion. Free, open, simple.

DEV: Fix `fabricator` deprecations (#17658)

Jarek Radosz23a267c75d7c
diff --git a/spec/fabricators/category_fabricator.rb b/spec/fabricators/category_fabricator.rb
index 06563200b30..5ffeff164e7 100644
--- a/spec/fabricators/category_fabricator.rb
+++ b/spec/fabricators/category_fabricator.rb
@@ -28,7 +28,7 @@ Fabricator(:private_category_with_definition, from: :private_category) do
end
Fabricator(:link_category, from: :category) do
- before_validation { |category, transients| category.topic_featured_link_allowed = true }
+ before_create { |category, transients| category.topic_featured_link_allowed = true }
end
Fabricator(:mailinglist_mirror_category, from: :category) do
diff --git a/spec/fabricators/post_fabricator.rb b/spec/fabricators/post_fabricator.rb
index 9b3b5d85f1b..3a23e045c6b 100644
--- a/spec/fabricators/post_fabricator.rb
+++ b/spec/fabricators/post_fabricator.rb
@@ -7,7 +7,7 @@ Fabricator(:post) do
post_type Post.types[:regular]
# Fabrication bypasses PostCreator, for performance reasons, where the counts are updated so we have to handle this manually here.
- after_save do |post, _transients|
+ after_create do |post, _transients|
UserStatCountUpdater.increment!(post)
end
end