提交 c8b0a6f0 编写于 作者: A Andrew White

Merge pull request #8963 from asanghi/regress_8631

adding regression test in master for #8631
......@@ -462,6 +462,27 @@ def url_for(options = {})
assert request.put?
end
test "post uneffected by local inflections" do
existing_acrnoyms = ActiveSupport::Inflector.inflections.acronyms.dup
existing_acrnoym_regex = ActiveSupport::Inflector.inflections.acronym_regex.dup
begin
ActiveSupport::Inflector.inflections do |inflect|
inflect.acronym "POS"
end
assert_equal "pos_t", "POST".underscore
request = stub_request "REQUEST_METHOD" => "POST"
assert_equal :post, ActionDispatch::Request::HTTP_METHOD_LOOKUP["POST"]
assert_equal :post, request.method_symbol
assert request.post?
ensure
# Reset original acronym set
ActiveSupport::Inflector.inflections do |inflect|
inflect.send(:instance_variable_set,"@acronyms",existing_acrnoyms)
inflect.send(:instance_variable_set,"@acronym_regex",existing_acrnoym_regex)
end
end
end
test "xml format" do
request = stub_request
request.expects(:parameters).at_least_once.returns({ :format => 'xml' })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册