Merge branch 'timezones' of git://github.com/epall/tracks into master.

Re-wrote all Date-related code to use Datetimes, created a migration to get rid of all date columns in the database, and got rid of Time.now calls that were not time zone-aware. Lots of time zone goodness!
This commit is contained in:
Eric Allen 2008-09-21 18:22:48 -07:00
commit ba9a9370cc
21 changed files with 111 additions and 78 deletions

View file

@ -20,28 +20,28 @@ class TodosHelperTest < Test::Rails::HelperTestCase
end
def test_show_date_in_past
date = 3.days.ago.to_date
date = 3.days.ago
html = show_date(date)
formatted_date = format_date(date)
assert_equal %Q{<a title="#{formatted_date}"><span class="red">Scheduled to show 3 days ago</span></a> }, html
end
def test_show_date_today
date = Time.zone.now.to_date
date = Time.zone.now
html = show_date(date)
formatted_date = format_date(date)
assert_equal %Q{<a title="#{formatted_date}"><span class="amber">Show Today</span></a> }, html
end
def test_show_date_tomorrow
date = 1.day.from_now.to_date
date = 1.day.from_now
html = show_date(date)
formatted_date = format_date(date)
assert_equal %Q{<a title="#{formatted_date}"><span class="amber">Show Tomorrow</span></a> }, html
end
def test_show_date_future
date = 10.days.from_now.to_date
date = 10.days.from_now
html = show_date(date)
formatted_date = format_date(date)
assert_equal %Q{<a title="#{formatted_date}"><span class="green">Show in 10 days</span></a> }, html