From ed1b344d32cedcd0d5141ff44a5b6842b4bd1927 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Fri, 21 Oct 2022 17:47:29 +0800 Subject: [PATCH] DEV: Persist records to DB in tests (#390) There is almost no reason for us to use `Fabricate.build` which does not persist the record to the database and is not what we encounter in production. --- spec/lib/assigner_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/lib/assigner_spec.rb b/spec/lib/assigner_spec.rb index 79a17cf..49085c7 100644 --- a/spec/lib/assigner_spec.rb +++ b/spec/lib/assigner_spec.rb @@ -201,7 +201,7 @@ RSpec.describe Assigner do it "doesn't assign if the user has too many assigned topics" do SiteSetting.max_assigned_topics = 1 - another_post = Fabricate.build(:post) + another_post = Fabricate(:post) assigner.assign(moderator) second_assign = described_class.new(another_post.topic, moderator_2).assign(moderator)