DEV: Fix flaky spec when creating a chat message from params (#27099)

This commit is contained in:
Jan Cernik 2024-05-21 17:39:17 -03:00 committed by GitHub
parent bc0ef9f7ee
commit 915982955b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,9 +38,9 @@ RSpec.describe "Chat New Message from params", type: :system do
it "creates a dm channel with multiple users" do
chat_page.visit_new_message([user_1, user_2])
expect(page).to have_current_path(
"/chat/c/#{user_1.username}-#{user_2.username}/#{Chat::Channel.last.id}",
)
users = [user_1.username, user_2.username].permutation.map { |u| u.join("-") }.join("|")
expect(page).to have_current_path(%r{/chat/c/(#{users})/#{Chat::Channel.last.id}})
end
end
end