mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-25 19:48:48 +01:00
Remove User#at_midnight
Replace it with a class called DateUtils with a method called `#midnight_for` that takes a preference instance and date to convert to midnight.
This commit is contained in:
parent
e7c6142684
commit
a1aaa283f1
6 changed files with 12 additions and 8 deletions
|
|
@ -20,7 +20,8 @@ class PreferenceTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_parse_date
|
||||
assert_equal @admin_user.at_midnight(Date.new(2007, 5, 20)).to_s, @admin_user.preference.parse_date('20/5/2007').to_s
|
||||
date = Time.new(2007, 05, 20).in_time_zone(@admin_user.preference.time_zone).at_midnight
|
||||
assert_equal date.to_s, @admin_user.preference.parse_date('20/5/2007').to_s
|
||||
end
|
||||
|
||||
def test_parse_date_returns_nil_if_string_is_empty
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue