From 73e5faea96f157bffdbfada51a7311446b600a1e Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 9 Feb 2024 21:29:33 -0800 Subject: [PATCH] Added test for dates --- test/rollup_test.rb | 10 ++++++++++ test/support/active_record.rb | 1 + 2 files changed, 11 insertions(+) diff --git a/test/rollup_test.rb b/test/rollup_test.rb index d848537..ca3d722 100644 --- a/test/rollup_test.rb +++ b/test/rollup_test.rb @@ -15,6 +15,16 @@ def test_attributes assert_equal 1, rollup.value end + def test_date + today = Date.today + User.create!(joined_on: today) + User.rollup("Test", column: :joined_on, time_zone: false) + + rollup = Rollup.last + assert_equal today, rollup.time + assert_equal today, Rollup.series("Test").keys.first + end + def test_rename create_users User.rollup("Test") diff --git a/test/support/active_record.rb b/test/support/active_record.rb index 03afe35..83d5a30 100644 --- a/test/support/active_record.rb +++ b/test/support/active_record.rb @@ -77,6 +77,7 @@ def dimensions_supported? t.string :browser t.jsonb :properties if dimensions_supported? t.integer :visits + t.date :joined_on t.timestamps end end