aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-12-10 19:49:10 -0800
committerSantiago Pastorino <santiago@wyeworks.com>2012-12-10 19:49:10 -0800
commit603e7f7ea507feb3cfea53c42b23be2b32dc240b (patch)
tree1ca5f6e5894c2cfa27a8c3c5ba453bafb05e4392 /railties/test/application
parent8dac9768b16c6cfaffa6c84abaaa7c4926020e0b (diff)
parentbaea5d69be52def2a81c31cd119f8dfcd2aa087b (diff)
downloadrails-603e7f7ea507feb3cfea53c42b23be2b32dc240b.tar.gz
rails-603e7f7ea507feb3cfea53c42b23be2b32dc240b.tar.bz2
rails-603e7f7ea507feb3cfea53c42b23be2b32dc240b.zip
Merge pull request #8468 from schneems/schneems/rack-index-page
Use Rails to Render Default Index Page
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/routing_test.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb
index ffcdeac7f0..3691ad2723 100644
--- a/railties/test/application/routing_test.rb
+++ b/railties/test/application/routing_test.rb
@@ -15,6 +15,12 @@ module ApplicationTests
teardown_app
end
+ test "rails/welcome in development" do
+ app("development")
+ get "/"
+ assert_equal 200, last_response.status
+ end
+
test "rails/info/routes in development" do
app("development")
get "/rails/info/routes"
@@ -27,6 +33,36 @@ module ApplicationTests
assert_equal 200, last_response.status
end
+ test "root takes precedence over internal welcome controller" do
+ app("development")
+
+ get '/'
+ assert_match %r{<h1>Getting started</h1>} , last_response.body
+
+ controller :foo, <<-RUBY
+ class FooController < ApplicationController
+ def index
+ render text: "foo"
+ end
+ end
+ RUBY
+
+ app_file 'config/routes.rb', <<-RUBY
+ AppTemplate::Application.routes.draw do
+ root to: "foo#index"
+ end
+ RUBY
+
+ get '/'
+ assert_equal 'foo', last_response.body
+ end
+
+ test "rails/welcome in production" do
+ app("production")
+ get "/"
+ assert_equal 404, last_response.status
+ end
+
test "rails/info/routes in production" do
app("production")
get "/rails/info/routes"