From 87fd17685050779b388cdcdfbc2458f753ef8e57 Mon Sep 17 00:00:00 2001 From: Tejaswini Date: Wed, 1 Sep 2021 17:33:25 +0530 Subject: [PATCH] Fixes: flaky test for avg response time --- spec/builders/v2/report_builder_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/builders/v2/report_builder_spec.rb b/spec/builders/v2/report_builder_spec.rb index 2cf75103a..f0c42b091 100644 --- a/spec/builders/v2/report_builder_spec.rb +++ b/spec/builders/v2/report_builder_spec.rb @@ -150,6 +150,12 @@ describe ::V2::ReportBuilder do end context 'when report type is label' do + before do + label_2.conversations.each do |conversation| + FactoryBot.create(:event, conversation: conversation, account: account, name: 'first_response') + end + end + it 'return conversations count' do params = { metric: 'conversations_count', @@ -215,8 +221,6 @@ describe ::V2::ReportBuilder do end it 'returns average first response time' do - FactoryBot.create(:event, conversation: label_2.conversations.last, account: account, name: 'first_response') - params = { metric: 'avg_first_response_time', type: :label,