diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-29 22:24:48 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-30 10:17:47 -0200 |
commit | 6b16c2788186d45c70bd1d9fc476407e3e265439 (patch) | |
tree | db7b781e5e1579ce703feb75f5f42abd08fce344 /activesupport/test | |
parent | 7f5466d58299db35a3d320e0b526001ae3be11a7 (diff) | |
download | rails-6b16c2788186d45c70bd1d9fc476407e3e265439.tar.gz rails-6b16c2788186d45c70bd1d9fc476407e3e265439.tar.bz2 rails-6b16c2788186d45c70bd1d9fc476407e3e265439.zip |
Add `travel_back` to remove stubs from `travel` and `travel_to`
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/test_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/test_test.rb b/activesupport/test/test_test.rb index 8a71ef4324..1e539d8d06 100644 --- a/activesupport/test/test_test.rb +++ b/activesupport/test/test_test.rb @@ -201,4 +201,16 @@ class TimeHelperTest < ActiveSupport::TestCase assert_not_equal expected_time, Time.now assert_not_equal Date.new(2004, 11, 24), Date.today end + + def test_time_helper_travel_back + expected_time = Time.new(2004, 11, 24, 01, 04, 44) + + travel_to expected_time + assert_equal expected_time, Time.now + assert_equal Date.new(2004, 11, 24), Date.today + travel_back + + assert_not_equal expected_time, Time.now + assert_not_equal Date.new(2004, 11, 24), Date.today + end end |