aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/mount_test.rb
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2013-06-21 08:51:28 +0200
committerPiotr Sarnacki <drogus@gmail.com>2013-06-21 08:56:19 +0200
commit50311f1391ddd8e0349d74eb57f04b7e0045a27d (patch)
treeac64667f829e7790f3d7c1d65fe81b8b981f64a3 /actionpack/test/dispatch/mount_test.rb
parent5ac22989d3f18bd3bf1011ca5ffd0a045e394d2c (diff)
downloadrails-50311f1391ddd8e0349d74eb57f04b7e0045a27d.tar.gz
rails-50311f1391ddd8e0349d74eb57f04b7e0045a27d.tar.bz2
rails-50311f1391ddd8e0349d74eb57f04b7e0045a27d.zip
Don't remove trailing slash from PATH_INFO for mounted apps
Previously when app was mounted as following: class Foo def call(env) [200, {}, [env['PATH_INFO']]] end end RackMountRailsBug::Application.routes.draw do mount RackTest.new => "/foo" end trailing slash was removed from PATH_INFO. For example requesting GET /foo/bar/ on routes defined above would result in a response containing "/foo/bar" instead of "/foo/bar/". This commit fixes the issue. (closes #3215)
Diffstat (limited to 'actionpack/test/dispatch/mount_test.rb')
-rw-r--r--actionpack/test/dispatch/mount_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/mount_test.rb b/actionpack/test/dispatch/mount_test.rb
index e5e28c28be..30e95a0b75 100644
--- a/actionpack/test/dispatch/mount_test.rb
+++ b/actionpack/test/dispatch/mount_test.rb
@@ -33,6 +33,11 @@ class TestRoutingMount < ActionDispatch::IntegrationTest
Router
end
+ def test_trailing_slash_is_not_removed_from_path_info
+ get "/sprockets/omg/"
+ assert_equal "/sprockets -- /omg/", response.body
+ end
+
def test_mounting_sets_script_name
get "/sprockets/omg"
assert_equal "/sprockets -- /omg", response.body