mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-15 21:55:29 +01:00
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:
commit
ba9a9370cc
21 changed files with 111 additions and 78 deletions
|
|
@ -25,7 +25,7 @@ class ProjectsControllerTest < TodoContainerControllerTestBase
|
|||
assert_equal 1, assigns['deferred'].size
|
||||
|
||||
t = p.not_done_todos[0]
|
||||
t.show_from = 1.days.from_now.utc.to_date
|
||||
t.show_from = 1.days.from_now.utc
|
||||
t.save!
|
||||
|
||||
get :show, :id => p.to_param
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
|
|||
new_todo = Todo.find_by_recurring_todo_id 5
|
||||
|
||||
# due date should be the target_date
|
||||
assert_equal Time.utc(target_date.year, target_date.month, target_date.day), new_todo.due
|
||||
assert_equal users(:admin_user).at_midnight(Date.new(target_date.year, target_date.month, target_date.day)), new_todo.due
|
||||
|
||||
# show_from should be nil since now+4.days-10.days is in the past
|
||||
assert_equal nil, new_todo.show_from
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class TodosControllerTest < Test::Rails::TestCase
|
|||
assert_equal "Call Warren Buffet to find out how much he makes per day", t.description
|
||||
assert_equal "foo, bar", t.tag_list
|
||||
expected = Date.new(2006,11,30)
|
||||
actual = t.due
|
||||
actual = t.due.to_date
|
||||
assert_equal expected, actual, "Expected #{expected.to_s(:db)}, was #{actual.to_s(:db)}"
|
||||
end
|
||||
|
||||
|
|
@ -328,7 +328,7 @@ class TodosControllerTest < Test::Rails::TestCase
|
|||
assert t.active?
|
||||
assert_equal 'test notes', t.notes
|
||||
assert_nil t.show_from
|
||||
assert_equal Date.new(2007,1,2).to_s, t.due.to_s
|
||||
assert_equal Date.new(2007,1,2), t.due.to_date
|
||||
end
|
||||
|
||||
def test_mobile_create_action_redirects_to_mobile_home_page_when_successful
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue