chore: Use Round Robin service for team assignment (#4237)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Sojan Jose
2022-03-28 14:38:07 +05:30
committed by GitHub
parent e8bc30e3c6
commit 823c0ab6a7
6 changed files with 86 additions and 22 deletions

View File

@@ -35,6 +35,9 @@ RSpec.describe 'Conversation Assignment API', type: :request do
end
it 'assigns a team to the conversation' do
team_member = create(:user, account: account, role: :agent)
create(:inbox_member, inbox: conversation.inbox, user: team_member)
create(:team_member, team: team, user: team_member)
params = { team_id: team.id }
post api_v1_account_conversation_assignments_url(account_id: account.id, conversation_id: conversation.display_id),
@@ -44,6 +47,8 @@ RSpec.describe 'Conversation Assignment API', type: :request do
expect(response).to have_http_status(:success)
expect(conversation.reload.team).to eq(team)
# assignee will be from team
expect(conversation.reload.assignee).to eq(team_member)
end
end