mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-27 03:06:11 +01:00
Overhaul of Time.now stuff because Time.now is unaware of time zones. Need to use Time.zone.now (Time.now.utc works fine when dealing with the database, since it is *always* in UTC)
This commit is contained in:
parent
f52a2eafa8
commit
3647d79587
10 changed files with 60 additions and 60 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue