diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-17 11:20:12 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-17 11:30:17 -0700 |
commit | 03d071d3cf9a29708aaceb19f2a7b934a1dec0d1 (patch) | |
tree | dd5d0e9dff6a44b99926df6709d8463efda129fc /railties/test | |
parent | dddc093a1a3330a0366f9220f14435b17555a6bb (diff) | |
download | rails-03d071d3cf9a29708aaceb19f2a7b934a1dec0d1.tar.gz rails-03d071d3cf9a29708aaceb19f2a7b934a1dec0d1.tar.bz2 rails-03d071d3cf9a29708aaceb19f2a7b934a1dec0d1.zip |
adding a test for root path in the app
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/routing_test.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb index e50d744e26..4cdc6549db 100644 --- a/railties/test/application/routing_test.rb +++ b/railties/test/application/routing_test.rb @@ -229,6 +229,30 @@ module ApplicationTests end end + def test_root_path + app('development') + + 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 + get 'foo', :to => 'foo#index' + root :to => 'foo#index' + end + RUBY + + remove_file 'public/index.html' + + get '/' + assert_equal 'foo', last_response.body + end + test 'routes are added and removed when reloading' do app('development') |