aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/routing_test.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2014-11-29 15:31:12 -0700
committerSean Griffin <sean@seantheprogrammer.com>2014-11-29 15:31:12 -0700
commit5493d16d9e2fbc8efb0535c7a704a83d460a1beb (patch)
treea7cb945964ff8b477885414fdf6150ad73c1c577 /railties/test/application/routing_test.rb
parentf8c27e2a52847d8c293d1015b44e53160e7d684e (diff)
parentf413cbee8dd702e2cae550c04b16e6c98411aeab (diff)
downloadrails-5493d16d9e2fbc8efb0535c7a704a83d460a1beb.tar.gz
rails-5493d16d9e2fbc8efb0535c7a704a83d460a1beb.tar.bz2
rails-5493d16d9e2fbc8efb0535c7a704a83d460a1beb.zip
Merge pull request #17823 from byroot/fix-mount-rack-apps-with-as
Pure rack apps can be mounted with a name
Diffstat (limited to 'railties/test/application/routing_test.rb')
-rw-r--r--railties/test/application/routing_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb
index 8576a2b738..cbada6be97 100644
--- a/railties/test/application/routing_test.rb
+++ b/railties/test/application/routing_test.rb
@@ -123,6 +123,26 @@ module ApplicationTests
assert_equal '/archives', last_response.body
end
+ test "mount named rack app" do
+ controller :foo, <<-RUBY
+ class FooController < ApplicationController
+ def index
+ render text: my_blog_path
+ end
+ end
+ RUBY
+
+ app_file 'config/routes.rb', <<-RUBY
+ Rails.application.routes.draw do
+ mount lambda { |env| [200, {}, [env["PATH_INFO"]]] }, at: "/blog", as: "my_blog"
+ get '/foo' => 'foo#index'
+ end
+ RUBY
+
+ get '/foo'
+ assert_equal '/blog', last_response.body
+ end
+
test "multiple controllers" do
controller :foo, <<-RUBY
class FooController < ApplicationController