Fix various off-by-one errors in statistics time ranges (#40193)
Co-authored-by: Shlee <github@shl.ee>
This commit is contained in:
1 parent
f1f3dd8720
commit
3ccfbbe195
7 files changed
+12
-6
No files matched your search
@@ -17,6 +17,10 @@ RSpec.describe Admin::Metrics::Measure::TagUsesMeasure do
|
||||
let(:bob) { Fabricate(:account, domain: 'bob.example') }
|
||||
|
||||
before do
|
||||
2.times do
|
||||
travel_to(3.days.ago) { add_tag_history(alice) }
|
||||
end
|
||||
|
||||
3.times do
|
||||
travel_to(2.days.ago) { add_tag_history(alice) }
|
||||
end
|
||||
@@ -40,6 +44,8 @@ RSpec.describe Admin::Metrics::Measure::TagUsesMeasure do
|
||||
include(date: 1.day.ago.midnight.to_time, value: '4'),
|
||||
include(date: 0.days.ago.midnight.to_time, value: '1')
|
||||
)
|
||||
expect(subject.previous_total)
|
||||
.to eq 2
|
||||
end
|
||||
|
||||
def add_tag_history(account)
|
||||
|
||||
Reference in new issue
Block a user