Skip to content

Commit

Permalink
Added test for dates
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 10, 2024
1 parent 8f7339f commit 73e5fae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/rollup_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions test/support/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 73e5fae

Please sign in to comment.