fix: assignee_changed callback not getting triggered during conversation creation (#9334)
The reload method in our callback was refreshing the object and hence the saved_change_to_assignee_id? Method wasn't working in the following callbacks. This impacted the listeners subscribing to the event `ASSIGNEE_CHANGE`, `TEAM_CHANGE` etc
This commit is contained in:
@@ -26,10 +26,6 @@ shared_examples_for 'auto_assignment_handler' do
|
||||
expect(conversation.reload.assignee).to eq(agent)
|
||||
end
|
||||
|
||||
it 'adds assignee to conversation participants' do
|
||||
expect(conversation.conversation_participants.map(&:user)).to include(agent)
|
||||
end
|
||||
|
||||
it 'will not auto assign agent if enable_auto_assignment is false' do
|
||||
inbox.update(enable_auto_assignment: false)
|
||||
|
||||
|
||||
@@ -107,7 +107,11 @@ RSpec.describe Message do
|
||||
end
|
||||
|
||||
describe 'message create event' do
|
||||
let(:conversation) { create(:conversation) }
|
||||
let!(:conversation) { create(:conversation) }
|
||||
|
||||
before do
|
||||
conversation.reload
|
||||
end
|
||||
|
||||
it 'updates the conversation first reply created at if it is the first outgoing message' do
|
||||
expect(conversation.first_reply_created_at).to be_nil
|
||||
|
||||
Reference in New Issue
Block a user