Merge branch 'develop' into feat/reporting-events-rollup
This commit is contained in:
@@ -61,7 +61,7 @@ RSpec.describe AutoAssignment::RateLimiter do
|
||||
|
||||
it 'still tracks the assignment with default window' do
|
||||
expected_key = format(Redis::RedisKeys::ASSIGNMENT_KEY, inbox_id: inbox.id, agent_id: agent.id, conversation_id: conversation.id)
|
||||
expect(Redis::Alfred).to receive(:set).with(expected_key, conversation.id.to_s, ex: 24.hours.to_i)
|
||||
expect(Redis::Alfred).to receive(:set).with(expected_key, conversation.id.to_s, ex: 5.minutes.to_i)
|
||||
rate_limiter.track_assignment(conversation)
|
||||
end
|
||||
end
|
||||
@@ -154,12 +154,12 @@ RSpec.describe AutoAssignment::RateLimiter do
|
||||
allow(inbox).to receive(:assignment_policy).and_return(assignment_policy)
|
||||
end
|
||||
|
||||
it 'uses the default window value of 24 hours' do
|
||||
it 'uses the default window value of 5 minutes' do
|
||||
expected_key = format(Redis::RedisKeys::ASSIGNMENT_KEY, inbox_id: inbox.id, agent_id: agent.id, conversation_id: conversation.id)
|
||||
expect(Redis::Alfred).to receive(:set).with(
|
||||
expected_key,
|
||||
conversation.id.to_s,
|
||||
ex: 86_400
|
||||
ex: 5.minutes.to_i
|
||||
)
|
||||
rate_limiter.track_assignment(conversation)
|
||||
end
|
||||
|
||||
@@ -2,11 +2,17 @@ require 'rails_helper'
|
||||
|
||||
describe Messages::NewMessageNotificationService do
|
||||
context 'when message is not notifiable' do
|
||||
it 'will not create any notifications' do
|
||||
it 'will not create any notifications for activity messages' do
|
||||
message = build(:message, message_type: :activity)
|
||||
expect(NotificationBuilder).not_to receive(:new)
|
||||
described_class.new(message: message).perform
|
||||
end
|
||||
|
||||
it 'will not create any notifications for private messages' do
|
||||
message = build(:message, message_type: :outgoing, private: true)
|
||||
expect(NotificationBuilder).not_to receive(:new)
|
||||
described_class.new(message: message).perform
|
||||
end
|
||||
end
|
||||
|
||||
context 'when message is notifiable' do
|
||||
|
||||
Reference in New Issue
Block a user