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:
Eric Allen 2008-09-21 18:03:35 -07:00
parent f52a2eafa8
commit 3647d79587
10 changed files with 60 additions and 60 deletions

View file

@ -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