Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding a test for root path in the app

  • Loading branch information...
commit 94e68e7ad32b2e167c6ebc1d0b642f706761136d 1 parent 5e4683f
@tenderlove tenderlove authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 railties/test/application/routing_test.rb
View
24 railties/test/application/routing_test.rb
@@ -277,6 +277,30 @@ def baz
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')
Please sign in to comment.
Something went wrong with that request. Please try again.