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.
This commit is contained in:
Alan Guo Xiang Tan 2022-10-21 17:47:29 +08:00 committed by GitHub
parent 7ec6c78aa2
commit ed1b344d32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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