DEV: Disable SearchIndexer after fabrication (#21378)

SearchIndexer is only automatically disabled in `before_all` and `before` blocks which means at the start
of test runs. Enabling the SearchIndexer in one `fab!` block will affect
all other `fab!` blocks which is not ideal as we may be indexing stuff
for search when we don't need to.
This commit is contained in:
Alan Guo Xiang Tan
2023-05-04 09:20:52 +08:00
committed by GitHub
parent 9a3257cb33
commit afc1611be7
6 changed files with 42 additions and 45 deletions
+3 -2
View File
@@ -653,8 +653,9 @@ RSpec.describe Topic do
context "with a similar topic" do
fab!(:post) do
SearchIndexer.enable
create_post(title: "Evil trout is the dude who posted this topic")
with_search_indexer_enabled do
create_post(title: "Evil trout is the dude who posted this topic")
end
end
let(:topic) { post.topic }