@@ -56,19 +56,6 @@ RSpec.describe Conversation, type: :model do
|
||||
expect(Rails.configuration.dispatcher).to have_received(:dispatch)
|
||||
.with(described_class::CONVERSATION_CREATED, kind_of(Time), conversation: conversation)
|
||||
end
|
||||
|
||||
it 'queues AutoResolveConversationsJob post creation if auto resolve duration present' do
|
||||
account.update(auto_resolve_duration: 30)
|
||||
expect do
|
||||
create(
|
||||
:conversation,
|
||||
account: account,
|
||||
contact: create(:contact, account: account),
|
||||
inbox: inbox,
|
||||
assignee: nil
|
||||
)
|
||||
end.to have_enqueued_job(AutoResolveConversationsJob)
|
||||
end
|
||||
end
|
||||
|
||||
describe '.after_update' do
|
||||
@@ -138,18 +125,6 @@ RSpec.describe Conversation, type: :model do
|
||||
.with(conversation2, { account_id: conversation2.account_id, inbox_id: conversation2.inbox_id, message_type: :activity,
|
||||
content: system_resolved_message })
|
||||
end
|
||||
|
||||
it 'does not trigger AutoResolutionJob if conversation reopened and account does not have auto resolve duration' do
|
||||
expect { conversation.update(status: :open) }
|
||||
.not_to have_enqueued_job(AutoResolveConversationsJob).with(conversation.id)
|
||||
end
|
||||
|
||||
it 'does trigger AutoResolutionJob if conversation reopened and account has auto resolve duration' do
|
||||
account.update(auto_resolve_duration: 40)
|
||||
conversation.resolved!
|
||||
conversation.reload.update(status: :open)
|
||||
expect(AutoResolveConversationsJob).to have_been_enqueued.with(conversation.id)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#update_labels' do
|
||||
|
||||
Reference in New Issue
Block a user