chore: Add controllers for conversation participants (#6462)
Co-authored-by: Aswin Dev P.S <aswindevps@gmail.com> Co-authored-by: Sojan Jose <sojan@chatwoot.com>
This commit is contained in:
@@ -73,6 +73,10 @@ shared_examples_for 'assignment_handler' do
|
||||
end
|
||||
let(:assignment_mailer) { instance_double(AgentNotifications::ConversationNotificationsMailer, deliver: true) }
|
||||
|
||||
before do
|
||||
create(:inbox_member, user: agent, inbox: conversation.inbox)
|
||||
end
|
||||
|
||||
it 'assigns the agent to conversation' do
|
||||
expect(update_assignee).to be(true)
|
||||
expect(conversation.reload.assignee).to eq(agent)
|
||||
@@ -85,6 +89,10 @@ shared_examples_for 'assignment_handler' do
|
||||
expect(update_assignee).to be(true)
|
||||
end
|
||||
|
||||
it 'adds assignee to conversation participants' do
|
||||
expect { update_assignee }.to change { conversation.conversation_participants.count }.by(1)
|
||||
end
|
||||
|
||||
context 'when agent is current user' do
|
||||
before do
|
||||
Current.user = agent
|
||||
|
||||
Reference in New Issue
Block a user