diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-28 16:30:14 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-28 16:30:14 -0800 |
commit | 54fdd33f33e6d42cf034a19cf64c6c52426de872 (patch) | |
tree | 1c280903afc73d6013010d749621146cd09ea7f1 /actionpack/test/template | |
parent | 19c763f7831e08606e6b4fa516f5ad3b00c6428f (diff) | |
download | rails-54fdd33f33e6d42cf034a19cf64c6c52426de872.tar.gz rails-54fdd33f33e6d42cf034a19cf64c6c52426de872.tar.bz2 rails-54fdd33f33e6d42cf034a19cf64c6c52426de872.zip |
use a subclass of AS::TZ for testing html output
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/date_helper_test.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb index b4eb3f76e1..aca2fef170 100644 --- a/actionpack/test/template/date_helper_test.rb +++ b/actionpack/test/template/date_helper_test.rb @@ -1882,10 +1882,17 @@ class DateHelperTest < ActionView::TestCase end def test_datetime_select_defaults_to_time_zone_now_when_config_time_zone_is_set - time = stub(:year => 2004, :month => 6, :day => 15, :hour => 16, :min => 35, :sec => 0) - time_zone = mock() - time_zone.expects(:now).returns time - Time.zone = time_zone + # The love zone is UTC+0 + mytz = Class.new(ActiveSupport::TimeZone) { + attr_accessor :now + }.create('tenderlove', 0) + + now = Time.mktime(2004, 6, 15, 16, 35, 0) + mytz.now = now + Time.zone = mytz + + assert_equal mytz, Time.zone + @post = Post.new expected = %{<select id="post_updated_at_1i" name="post[updated_at(1i)]">\n} |