提交 e30a263b 编写于 作者: G gbuesing

InstanceTag#default_time_from_options overflows to DateTime

上级 be858689
* InstanceTag#default_time_from_options overflows to DateTime [Geoff Buesing]
*2.1.0 RC1 (May 11th, 2008)*
* Fixed that forgery protection can be used without session tracking (Peter Jones) [#139]
......
......@@ -689,7 +689,7 @@ def default_time_from_options(default)
default[key] ||= time.send(key)
end
Time.utc(default[:year], default[:month], default[:day], default[:hour], default[:min], default[:sec])
Time.utc_time(default[:year], default[:month], default[:day], default[:hour], default[:min], default[:sec])
end
end
end
......
......@@ -1722,6 +1722,12 @@ def test_instance_tag_default_time_from_options_respects_hash_arg_settings_when_
assert_equal 2, dummy_instance_tag.send!(:default_time_from_options, :hour => 2).hour
end
end
def test_instance_tag_default_time_from_options_handles_far_future_date
dummy_instance_tag = ActionView::Helpers::InstanceTag.new(1,2,3)
time = dummy_instance_tag.send!(:default_time_from_options, :year => 2050, :month => 2, :day => 10, :hour => 15, :min => 30, :sec => 45)
assert_equal 2050, time.year
end
end
protected
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册