chore: API improvements (#3637)

- Unique validations for Inbox members and Team member objects
- Move notification processing to Async
This commit is contained in:
Sojan Jose
2021-12-21 22:48:01 +05:30
committed by GitHub
parent 262474166f
commit 009abc1948
13 changed files with 48 additions and 31 deletions

View File

@@ -78,19 +78,9 @@ shared_examples_for 'assignment_handler' do
expect(conversation.reload.assignee).to eq(agent)
end
it 'creates a new notification for the agent' do
it 'dispaches assignee changed event' do
expect(EventDispatcherJob).to(have_been_enqueued.at_least(:once).with('assignee.changed', anything, anything))
expect(update_assignee).to eq(true)
expect(agent.notifications.count).to eq(1)
end
it 'does not create assignment notification if notification setting is turned off' do
notification_setting = agent.notification_settings.first
notification_setting.unselect_all_email_flags
notification_setting.unselect_all_push_flags
notification_setting.save!
expect(update_assignee).to eq(true)
expect(agent.notifications.count).to eq(0)
end
context 'when agent is current user' do