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:20:12 -0700 |
commit | 94e68e7ad32b2e167c6ebc1d0b642f706761136d (patch) | |
tree | b80f7985f805aeb1bb5b8af9487b927b33462863 /railties | |
parent | 5e4683f76a30174500a4882ae7b14ad96ff11f7f (diff) | |
download | rails-94e68e7ad32b2e167c6ebc1d0b642f706761136d.tar.gz rails-94e68e7ad32b2e167c6ebc1d0b642f706761136d.tar.bz2 rails-94e68e7ad32b2e167c6ebc1d0b642f706761136d.zip |
adding a test for root path in the app
Diffstat (limited to 'railties')
-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 22de640236..25372d0a50 100644 --- a/railties/test/application/routing_test.rb +++ b/railties/test/application/routing_test.rb @@ -277,6 +277,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') |