mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-10 09:24:22 +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
|
|
@ -10,7 +10,7 @@ describe Todo do
|
|||
|
||||
def create_todo(attributes={})
|
||||
todo = Todo.new(valid_attributes(attributes))
|
||||
todo.stub!(:user).and_return(mock_model(User, :date => Time.now))
|
||||
todo.stub!(:user).and_return(mock_model(User, :date => Time.zone.now))
|
||||
todo.save!
|
||||
todo
|
||||
end
|
||||
|
|
@ -32,7 +32,7 @@ describe Todo do
|
|||
|
||||
it 'ensures that show_from is a date in the future' do
|
||||
todo = Todo.new(valid_attributes)
|
||||
todo.stub!(:user).and_return(mock_model(User, :date => Time.now))
|
||||
todo.stub!(:user).and_return(mock_model(User, :date => Time.zone.now))
|
||||
todo.show_from = 3.days.ago
|
||||
todo.should have(1).error_on(:show_from)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -185,8 +185,9 @@ describe User do
|
|||
user.save!
|
||||
user.create_preference
|
||||
user.preference.update_attribute('time_zone', 'Pacific Time (US & Canada)')
|
||||
# Time.zone = 'Pacific Time (US & Canada)'
|
||||
Time.stub!(:now).and_return(Time.new.end_of_day - 20.minutes)
|
||||
todo = user.todos.build(:description => 'test task', :context => context, :show_from => user.date + 1)
|
||||
todo = user.todos.build(:description => 'test task', :context => context, :show_from => user.date + 1.days)
|
||||
todo.save!
|
||||
|
||||
user.deferred_todos.find_and_activate_ready
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue