fix: Use last_activity_at instead of updated_at for sorting (#1281)
Co-authored-by: Akash Srivastava <akash.srivastava.1911@gmail.com>
This commit is contained in:
@@ -370,7 +370,7 @@ RSpec.describe Conversation, type: :model do
|
||||
messages: [],
|
||||
inbox_id: conversation.inbox_id,
|
||||
status: conversation.status,
|
||||
timestamp: conversation.created_at.to_i,
|
||||
timestamp: conversation.last_activity_at.to_i,
|
||||
can_reply: true,
|
||||
channel: 'Channel::WebWidget',
|
||||
contact_last_seen_at: conversation.contact_last_seen_at.to_i,
|
||||
|
||||
@@ -12,6 +12,10 @@ RSpec.describe Message, type: :model do
|
||||
context 'when message is created' do
|
||||
let(:message) { build(:message, account: create(:account)) }
|
||||
|
||||
it 'updates conversation last_activity_at when created' do
|
||||
expect(message.created_at).to eq message.conversation.last_activity_at
|
||||
end
|
||||
|
||||
it 'triggers ::MessageTemplates::HookExecutionService' do
|
||||
hook_execution_service = double
|
||||
allow(::MessageTemplates::HookExecutionService).to receive(:new).and_return(hook_execution_service)
|
||||
|
||||
Reference in New Issue
Block a user