A platform for community discussion. Free, open, simple.
DEV: Fix system test failure when ran in parallel (#21377)
Alan Guo Xiang Tan9a3257cb33f3
diff --git a/spec/system/user_selector_spec.rb b/spec/system/user_selector_spec.rbindex 5e90c29121c..3ad50ec0974 100644--- a/spec/system/user_selector_spec.rb+++ b/spec/system/user_selector_spec.rb@@ -5,6 +5,11 @@ describe "User selector", type: :system, js: true dofab!(:post) { Fabricate(:post, topic: topic) }fab!(:current_user) { Fabricate(:admin) }+ fab!(:user) do+ SearchIndexer.enable+ Fabricate(:user, username: "someone")+ end+before docurrent_user.activatesign_in(current_user)@@ -14,11 +19,11 @@ describe "User selector", type: :system, js: true doit "correctly shows the user" dovisit("/t/-/#{topic.id}")find(".btn-primary.create").click- find(".d-editor-input").fill_in(with: "Hello @dis")+ find(".d-editor-input").fill_in(with: "Hello @som")within(".autocomplete.ac-user") do |el|- expect(el).to have_selector(".selected .avatar[title=discobot]")- expect(el.find(".selected .username")).to have_content("discobot")+ expect(el).to have_selector(".selected .avatar[title=someone]")+ expect(el.find(".selected .username")).to have_content("someone")endendend