feat: Add None option in automation assign agent actions (#7900)

This commit is contained in:
Muhsin Keloth
2023-09-14 09:01:58 +05:30
committed by GitHub
parent 5e6e234afe
commit 2d4ef0c328
3 changed files with 26 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
require 'rails_helper'
describe ActionService do
let(:account) { create(:account) }
describe '#resolve_conversation' do
let(:conversation) { create(:conversation) }
let(:action_service) { described_class.new(conversation) }
@@ -27,5 +29,17 @@ describe ActionService do
end
end
describe '#assign_agent' do
let(:agent) { create(:user, account: account, role: :agent) }
let(:conversation) { create(:conversation, account: account) }
let(:inbox_member) { create(:inbox_member, inbox: conversation.inbox, user: agent) }
let(:action_service) { described_class.new(conversation) }
it 'unassigns the conversation if agent id is nil' do
action_service.assign_agent(['nil'])
expect(conversation.reload.assignee).to be_nil
end
end
# TODO: Expand this test suite
end