0
@@ -1888,6 +1888,153 @@ class DateHelperTest < ActionView::TestCase
0
assert_dom_equal expected, datetime_select("post", "updated_at", {}, :class => 'selector')
0
+ def test_date_select_should_not_change_passed_options_hash
0
+ @post.updated_at = Time.local(2008, 7, 16, 23, 30)
0
+ :order => [ :year, :month, :day ],
0
+ :default => { :year => 2008, :month => 7, :day => 16, :hour => 23, :minute => 30, :second => 1 },
0
+ :discard_type => false,
0
+ :include_blank => false,
0
+ :ignore_date => false,
0
+ :include_seconds => true
0
+ date_select(@post, :updated_at, options)
0
+ # note: the literal hash is intentional to show that the actual options hash isn't modified
0
+ :order => [ :year, :month, :day ],
0
+ :default => { :year => 2008, :month => 7, :day => 16, :hour => 23, :minute => 30, :second => 1 },
0
+ :discard_type => false,
0
+ :include_blank => false,
0
+ :ignore_date => false,
0
+ :include_seconds => true
0
+ def test_datetime_select_should_not_change_passed_options_hash
0
+ @post.updated_at = Time.local(2008, 7, 16, 23, 30)
0
+ :order => [ :year, :month, :day ],
0
+ :default => { :year => 2008, :month => 7, :day => 16, :hour => 23, :minute => 30, :second => 1 },
0
+ :discard_type => false,
0
+ :include_blank => false,
0
+ :ignore_date => false,
0
+ :include_seconds => true
0
+ datetime_select(@post, :updated_at, options)
0
+ # note: the literal hash is intentional to show that the actual options hash isn't modified
0
+ :order => [ :year, :month, :day ],
0
+ :default => { :year => 2008, :month => 7, :day => 16, :hour => 23, :minute => 30, :second => 1 },
0
+ :discard_type => false,
0
+ :include_blank => false,
0
+ :ignore_date => false,
0
+ :include_seconds => true
0
+ def test_time_select_should_not_change_passed_options_hash
0
+ @post.updated_at = Time.local(2008, 7, 16, 23, 30)
0
+ :order => [ :year, :month, :day ],
0
+ :default => { :year => 2008, :month => 7, :day => 16, :hour => 23, :minute => 30, :second => 1 },
0
+ :discard_type => false,
0
+ :include_blank => false,
0
+ :ignore_date => false,
0
+ :include_seconds => true
0
+ time_select(@post, :updated_at, options)
0
+ # note: the literal hash is intentional to show that the actual options hash isn't modified
0
+ :order => [ :year, :month, :day ],
0
+ :default => { :year => 2008, :month => 7, :day => 16, :hour => 23, :minute => 30, :second => 1 },
0
+ :discard_type => false,
0
+ :include_blank => false,
0
+ :ignore_date => false,
0
+ :include_seconds => true
0
+ def test_select_date_should_not_change_passed_options_hash
0
+ :order => [ :year, :month, :day ],
0
+ :default => { :year => 2008, :month => 7, :day => 16, :hour => 23, :minute => 30, :second => 1 },
0
+ :discard_type => false,
0
+ :include_blank => false,
0
+ :ignore_date => false,
0
+ :include_seconds => true
0
+ select_date(Date.today, options)
0
+ # note: the literal hash is intentional to show that the actual options hash isn't modified
0
+ :order => [ :year, :month, :day ],
0
+ :default => { :year => 2008, :month => 7, :day => 16, :hour => 23, :minute => 30, :second => 1 },
0
+ :discard_type => false,
0
+ :include_blank => false,
0
+ :ignore_date => false,
0
+ :include_seconds => true
0
+ def test_select_datetime_should_not_change_passed_options_hash
0
+ :order => [ :year, :month, :day ],
0
+ :default => { :year => 2008, :month => 7, :day => 16, :hour => 23, :minute => 30, :second => 1 },
0
+ :discard_type => false,
0
+ :include_blank => false,
0
+ :ignore_date => false,
0
+ :include_seconds => true
0
+ select_datetime(Time.now, options)
0
+ # note: the literal hash is intentional to show that the actual options hash isn't modified
0
+ :order => [ :year, :month, :day ],
0
+ :default => { :year => 2008, :month => 7, :day => 16, :hour => 23, :minute => 30, :second => 1 },
0
+ :discard_type => false,
0
+ :include_blank => false,
0
+ :ignore_date => false,
0
+ :include_seconds => true
0
+ def test_select_time_should_not_change_passed_options_hash
0
+ :order => [ :year, :month, :day ],
0
+ :default => { :year => 2008, :month => 7, :day => 16, :hour => 23, :minute => 30, :second => 1 },
0
+ :discard_type => false,
0
+ :include_blank => false,
0
+ :ignore_date => false,
0
+ :include_seconds => true
0
+ select_time(Time.now, options)
0
+ # note: the literal hash is intentional to show that the actual options hash isn't modified
0
+ :order => [ :year, :month, :day ],
0
+ :default => { :year => 2008, :month => 7, :day => 16, :hour => 23, :minute => 30, :second => 1 },
0
+ :discard_type => false,
0
+ :include_blank => false,
0
+ :ignore_date => false,
0
+ :include_seconds => true
0
def with_env_tz(new_tz = 'US/Eastern')
0
old_tz, ENV['TZ'] = ENV['TZ'], new_tz
Affected ticket is #638 – sorry. http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/638