FIX: Fix failing spec caused by unpersisted user instance (#19288)

Active Record's `to_sql` method seems to return an empty string instead
of the expected SQL query when called on a query involving an
unpersisted model instance.

This replaces the admin `user` used in the specs with a persisted instance.
This commit is contained in:
Selase Krakani 2022-12-02 03:28:05 +00:00 committed by GitHub
parent 1fbcf57767
commit a65c3ba079
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -953,7 +953,7 @@ describe Search do
context 'post searching' do context 'post searching' do
before do before do
SiteSetting.tagging_enabled = true SiteSetting.tagging_enabled = true
DiscourseTagging.tag_topic_by_names(post.topic, Guardian.new(Fabricate.build(:admin)), [tag.name, uppercase_tag.name]) DiscourseTagging.tag_topic_by_names(post.topic, Guardian.new(admin), [tag.name, uppercase_tag.name])
post.topic.save post.topic.save
end end