Skip to content

Instantly share code, notes, and snippets.

@joshuamiller
Created September 11, 2010 01:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuamiller/574664 to your computer and use it in GitHub Desktop.
Save joshuamiller/574664 to your computer and use it in GitHub Desktop.
should "accept timestamps" do
time = Time.now
Timecop.travel(time)
new_model = TestModel.new
new_model.save
assert_equal time, new_model.created_at
assert_equal time, new_model.updated_at
future = time + 10.minutes
Timecop.travel(future)
new_model.save
assert_equal future, new_model.updated_at
assert_equal time, new_model.created_at
Timecop.returnb
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment