Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding regression test in master for #8631 #8963

Merged
merged 1 commit into from Jan 16, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions actionpack/test/dispatch/request_test.rb
Expand Up @@ -462,6 +462,27 @@ def url_for(options = {})
assert request.put? assert request.put?
end 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 test "xml format" do
request = stub_request request = stub_request
request.expects(:parameters).at_least_once.returns({ :format => 'xml' }) request.expects(:parameters).at_least_once.returns({ :format => 'xml' })
Expand Down