aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-06-18 07:25:25 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-06-25 12:34:36 +0900
commite130ce456290f1efd39118419ca0783da0677ff1 (patch)
treeab4804a51c689a42446095a854b1dea9f74eadb0 /actionpack/test
parent1de0df86695f8fa2eeae6b8b46f9b53decfa6ec8 (diff)
downloadrails-e130ce456290f1efd39118419ca0783da0677ff1.tar.gz
rails-e130ce456290f1efd39118419ca0783da0677ff1.tar.bz2
rails-e130ce456290f1efd39118419ca0783da0677ff1.zip
make `as` option work with get parameters
Currently, if path is a relative path, add format without the discrimination of the query. Therefore, if there is a query, format at end of the query would been added, format was not be specified correctly. This fix add format to end of path rather than query.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/integration_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb
index 34fb3b1003..3b89531e90 100644
--- a/actionpack/test/controller/integration_test.rb
+++ b/actionpack/test/controller/integration_test.rb
@@ -1210,6 +1210,20 @@ class IntegrationRequestEncodersTest < ActionDispatch::IntegrationTest
end
end
+ def test_get_parameters_with_as_option
+ with_routing do |routes|
+ routes.draw do
+ ActiveSupport::Deprecation.silence do
+ get ':action' => FooController
+ end
+ end
+
+ get '/foos_json?foo=heyo', as: :json
+
+ assert_equal({ 'foo' => 'heyo' }, response.parsed_body)
+ end
+ end
+
private
def post_to_foos(as:)
with_routing do |routes|