aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2013-01-16 03:40:30 -0800
committerAndrew White <andyw@pixeltrix.co.uk>2013-01-16 03:40:30 -0800
commitc8b0a6f0b4651c52c94745dea868477e5f5375f5 (patch)
treecdda0e2846075bf949f6765c8f542ff001f48901 /actionpack/test
parent94384bdbd6aaf95e57887fa5821018b59ca65037 (diff)
parent3c190646103d838f6259eda0f6833da6efc03a84 (diff)
downloadrails-c8b0a6f0b4651c52c94745dea868477e5f5375f5.tar.gz
rails-c8b0a6f0b4651c52c94745dea868477e5f5375f5.tar.bz2
rails-c8b0a6f0b4651c52c94745dea868477e5f5375f5.zip
Merge pull request #8963 from asanghi/regress_8631
adding regression test in master for #8631
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/request_test.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb
index 02675c7f8c..39923d0d2b 100644
--- a/actionpack/test/dispatch/request_test.rb
+++ b/actionpack/test/dispatch/request_test.rb
@@ -462,6 +462,27 @@ class RequestTest < ActiveSupport::TestCase
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' })