Fix: Incoming Message Baileys Service Specs (#59)

* fix: update contact creation in messages.update event spec and remove redundant content update test

* test: fix spec

---------

Co-authored-by: gabrieljablonski <contact@gabrieljablonski.com>
This commit is contained in:
Cayo P. R. Oliveira 2025-05-31 18:19:39 -03:00 committed by GitHub
parent 9269a5e165
commit 8ec086f8d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -580,9 +580,10 @@ describe Whatsapp::IncomingMessageBaileysService do
context 'when processing messages.update event' do
let(:conversation) do
agent = create(:user, account: inbox.account, role: :agent)
contact = create(:contact, account: inbox.account)
contact_inbox = create(:contact_inbox, inbox: inbox, contact: contact)
create(:conversation, inbox: inbox, contact_inbox: contact_inbox, assignee_id: contact.id)
create(:conversation, inbox: inbox, contact_inbox: contact_inbox, assignee_id: agent.id)
end
let!(:message) { create(:message, inbox: inbox, conversation: conversation, source_id: 'msg_123', status: 'sent') }
let(:update_payload) { { key: { id: 'msg_123' }, update: { status: 3 } } }