From 65c6909419c34f36e83867b629c777996b2f9684 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 6 Mar 2024 14:08:06 +0100 Subject: [PATCH] DEV: rely on default session in smoke spec (#26054) --- .../system/reply_to_message/smoke_spec.rb | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/plugins/chat/spec/system/reply_to_message/smoke_spec.rb b/plugins/chat/spec/system/reply_to_message/smoke_spec.rb index 7ab916c4ccf..50ccc5562ec 100644 --- a/plugins/chat/spec/system/reply_to_message/smoke_spec.rb +++ b/plugins/chat/spec/system/reply_to_message/smoke_spec.rb @@ -20,11 +20,9 @@ RSpec.describe "Reply to message - smoke", type: :system do context "when two users create a thread on the same message" do it "works" do - using_session(:user_1) do - sign_in(user_1) - chat_page.visit_channel(channel_1) - channel_page.reply_to(original_message) - end + sign_in(user_1) + chat_page.visit_channel(channel_1) + channel_page.reply_to(original_message) using_session(:user_2) do sign_in(user_2) @@ -33,12 +31,9 @@ RSpec.describe "Reply to message - smoke", type: :system do expect(side_panel).to have_open_thread(original_message.thread) end - using_session(:user_1) do - thread_page.send_message("user1reply") - - expect(channel_page.message_thread_indicator(original_message)).to have_reply_count(1) - expect(thread_page.messages).to have_message(text: "user1reply") - end + thread_page.send_message("user1reply") + expect(channel_page.message_thread_indicator(original_message)).to have_reply_count(1) + expect(thread_page.messages).to have_message(text: "user1reply") using_session(:user_2) do |session| expect(thread_page.messages).to have_message(text: "user1reply") @@ -53,11 +48,9 @@ RSpec.describe "Reply to message - smoke", type: :system do session.quit end - using_session(:user_1) do - expect(thread_page.messages).to have_message(text: "user1reply") - expect(thread_page.messages).to have_message(text: "user2reply") - expect(channel_page.message_thread_indicator(original_message)).to have_reply_count(3) - end + expect(thread_page.messages).to have_message(text: "user1reply") + expect(thread_page.messages).to have_message(text: "user2reply") + expect(channel_page.message_thread_indicator(original_message)).to have_reply_count(3) end end end