Created
September 11, 2010 01:37
-
-
Save joshuamiller/574664 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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