feat: Add None option in automation assign agent actions (#7900)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user