Fix flaky reporting_event_listener_spec (#6923)

This commit is contained in:
Volodymyr Makukh
2023-04-19 08:12:45 +03:00
committed by GitHub
parent e6505fc7a4
commit b93b8cdab6

View File

@@ -63,8 +63,9 @@ describe ReportingEventListener do
# this ensures last_non_human_activity method accurately accounts for handoff events
context 'when last handoff event exists' do
let(:conversation_updated_at) { 20.seconds.from_now }
let(:human_message_created_at) { 62.seconds.from_now }
let(:now) { Time.zone.now }
let(:conversation_updated_at) { now + 20.seconds }
let(:human_message_created_at) { now + 62.seconds }
let(:new_conversation) { create(:conversation, account: account, inbox: inbox, assignee: user, updated_at: conversation_updated_at) }
let(:new_message) do
create(:message, message_type: 'outgoing', created_at: human_message_created_at, account: account, inbox: inbox,