1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add test for root

This commit is contained in:
David Heinemeier Hansson 2009-12-21 21:49:36 -08:00
parent 1de95077dc
commit 8e48a5ef0c

View file

@ -109,6 +109,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
scope ':access_token', :constraints => { :access_token => /\w{5,5}/ } do
resources :rooms
end
root :to => 'projects#index'
end
end
@ -458,6 +460,13 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
end
end
def test_root
with_test_routes do
get '/'
assert_equal 'projects#index', @response.body
end
end
private
def with_test_routes
real_routes, temp_routes = ActionController::Routing::Routes, Routes