diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2014-11-28 14:58:10 -0500 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2014-11-29 09:24:43 -0500 |
commit | f413cbee8dd702e2cae550c04b16e6c98411aeab (patch) | |
tree | f89d841643f81e4829e5af20b50e080d583be882 /railties/test | |
parent | ee614af6fa6c9e8cac70bcfd7d3583d0b4ff907b (diff) | |
download | rails-f413cbee8dd702e2cae550c04b16e6c98411aeab.tar.gz rails-f413cbee8dd702e2cae550c04b16e6c98411aeab.tar.bz2 rails-f413cbee8dd702e2cae550c04b16e6c98411aeab.zip |
Pure rack apps can be mounted with a name
See https://github.com/rails/rails/commit/9b15828b5c347395b42066a588c88e5eb4e72279#commitcomment-8764492
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/routing_test.rb | 20 |
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 |