From 45525f7b9ba3b309c66de7816d5ac60ddefa2404 Mon Sep 17 00:00:00 2001 From: Gabriel Jablonski Date: Mon, 24 Nov 2025 17:04:30 -0300 Subject: [PATCH] test: test: fix typing event specs (#155) --- .../v1/accounts/conversations/messages_controller_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/controllers/api/v1/accounts/conversations/messages_controller_spec.rb b/spec/controllers/api/v1/accounts/conversations/messages_controller_spec.rb index ce19e24bc..34464171d 100644 --- a/spec/controllers/api/v1/accounts/conversations/messages_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/conversations/messages_controller_spec.rb @@ -83,8 +83,7 @@ RSpec.describe 'Conversation Messages API', type: :request do it 'triggers typing off event for non-private messages' do params = { content: 'test-message', private: false } - allow(Rails.configuration.dispatcher).to receive(:dispatch) - .with('conversation.typing_off', kind_of(Time), hash_including(conversation: conversation, user: agent, is_private: false)) + allow(Rails.configuration.dispatcher).to receive(:dispatch).and_call_original post api_v1_account_conversation_messages_url(account_id: account.id, conversation_id: conversation.display_id), params: params, @@ -93,12 +92,12 @@ RSpec.describe 'Conversation Messages API', type: :request do expect(response).to have_http_status(:success) expect(Rails.configuration.dispatcher).to have_received(:dispatch) + .with('conversation.typing_off', kind_of(Time), hash_including(conversation: conversation, user: agent, is_private: false)) end it 'triggers typing off event for private messages' do params = { content: 'test-message', private: true } - allow(Rails.configuration.dispatcher).to receive(:dispatch).with('conversation.typing_off', kind_of(Time), - hash_including(conversation: conversation, user: agent, is_private: true)) + allow(Rails.configuration.dispatcher).to receive(:dispatch).and_call_original post api_v1_account_conversation_messages_url(account_id: account.id, conversation_id: conversation.display_id), params: params, @@ -107,6 +106,7 @@ RSpec.describe 'Conversation Messages API', type: :request do expect(response).to have_http_status(:success) expect(Rails.configuration.dispatcher).to have_received(:dispatch) + .with('conversation.typing_off', kind_of(Time), hash_including(conversation: conversation, user: agent, is_private: true)) end context 'when api inbox' do