chore: Take the count directly rather than grouping the conversations (#7535)
This commit is contained in:
@@ -6,6 +6,8 @@ describe V2::ReportBuilder do
|
||||
let_it_be(:label_1) { create(:label, title: 'Label_1', account: account) }
|
||||
let_it_be(:label_2) { create(:label, title: 'Label_2', account: account) }
|
||||
|
||||
# Update this spec to use travel_to
|
||||
# This spec breaks in certain timezone
|
||||
describe '#timeseries' do
|
||||
before_all do
|
||||
user = create(:user, account: account)
|
||||
@@ -156,13 +158,14 @@ describe V2::ReportBuilder do
|
||||
it 'returns argument error for incorrect group by' do
|
||||
params = {
|
||||
type: :account,
|
||||
metric: 'avg_first_response_time',
|
||||
since: (Time.zone.today - 3.days).to_time.to_i.to_s,
|
||||
until: Time.zone.today.end_of_day.to_time.to_i.to_s,
|
||||
group_by: 'test'.to_s
|
||||
}
|
||||
|
||||
builder = described_class.new(account, params)
|
||||
expect { builder.summary }.to raise_error(ArgumentError)
|
||||
expect { builder.timeseries }.to raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -296,6 +299,7 @@ describe V2::ReportBuilder do
|
||||
|
||||
it 'returns argument error for incorrect group by' do
|
||||
params = {
|
||||
metric: 'avg_first_response_time',
|
||||
type: :label,
|
||||
id: label_2.id,
|
||||
since: (Time.zone.today - 3.days).to_time.to_i.to_s,
|
||||
@@ -304,7 +308,7 @@ describe V2::ReportBuilder do
|
||||
}
|
||||
|
||||
builder = described_class.new(account, params)
|
||||
expect { builder.summary }.to raise_error(ArgumentError)
|
||||
expect { builder.timeseries }.to raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user