diff options
author | José Valim <jose.valim@gmail.com> | 2012-06-29 17:39:50 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-06-29 17:44:10 +0200 |
commit | 5e7d6bba79393de0279917f93b82f3b7b176f4b5 (patch) | |
tree | 1e9c6c8c183ba326efa33087d9b590c9196acec3 /railties/test/application | |
parent | 50b6110106a6e467f5e5f6303700522cebc60a9c (diff) | |
download | rails-5e7d6bba79393de0279917f93b82f3b7b176f4b5.tar.gz rails-5e7d6bba79393de0279917f93b82f3b7b176f4b5.tar.bz2 rails-5e7d6bba79393de0279917f93b82f3b7b176f4b5.zip |
Revert "Allow loading external route files from the router"
This reverts commit 6acebb38bc0637bc05c19d87f8767f16ce79189b.
Usage of this feature did not reveal any improvement in existing apps.
Conflicts:
actionpack/lib/action_dispatch/routing/mapper.rb
guides/source/routing.textile
railties/lib/rails/engine.rb
railties/lib/rails/paths.rb
railties/test/paths_test.rb
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/paths_test.rb | 2 | ||||
-rw-r--r-- | railties/test/application/routing_test.rb | 83 |
2 files changed, 0 insertions, 85 deletions
diff --git a/railties/test/application/paths_test.rb b/railties/test/application/paths_test.rb index e0893f53be..4029984ce9 100644 --- a/railties/test/application/paths_test.rb +++ b/railties/test/application/paths_test.rb @@ -50,8 +50,6 @@ module ApplicationTests assert_path @paths["config/locales"], "config/locales/en.yml" assert_path @paths["config/environment"], "config/environment.rb" assert_path @paths["config/environments"], "config/environments/development.rb" - assert_path @paths["config/routes.rb"], "config/routes.rb" - assert_path @paths["config/routes"], "config/routes" assert_equal root("app", "controllers"), @paths["app/controllers"].expanded.first end diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb index d1373ba202..396b1849d8 100644 --- a/railties/test/application/routing_test.rb +++ b/railties/test/application/routing_test.rb @@ -178,90 +178,7 @@ module ApplicationTests assert_equal 'WIN', last_response.body end - test "routes drawing from config/routes" do - app_file 'config/routes.rb', <<-RUBY - AppTemplate::Application.routes.draw do - draw :external - end - RUBY - - app_file 'config/routes/external.rb', <<-RUBY - get ':controller/:action' - RUBY - - controller :success, <<-RUBY - class SuccessController < ActionController::Base - def index - render :text => "success!" - end - end - RUBY - - app 'development' - get '/success/index' - assert_equal 'success!', last_response.body - end - {"development" => "baz", "production" => "bar"}.each do |mode, expected| - test "reloads routes when external configuration is changed in #{mode}" do - controller :foo, <<-RUBY - class FooController < ApplicationController - def bar - render :text => "bar" - end - - def baz - render :text => "baz" - end - end - RUBY - - app_file 'config/routes.rb', <<-RUBY - AppTemplate::Application.routes.draw do - draw :external - end - RUBY - - app_file 'config/routes/external.rb', <<-RUBY - get 'foo', :to => 'foo#bar' - RUBY - - app(mode) - - get '/foo' - assert_equal 'bar', last_response.body - - app_file 'config/routes/external.rb', <<-RUBY - get 'foo', :to => 'foo#baz' - RUBY - - sleep 0.1 - - get '/foo' - assert_equal expected, last_response.body - - app_file 'config/routes.rb', <<-RUBY - AppTemplate::Application.routes.draw do - draw :external - draw :other_external - end - RUBY - - app_file 'config/routes/other_external.rb', <<-RUBY - get 'win', :to => 'foo#baz' - RUBY - - sleep 0.1 - - get '/win' - - if mode == "development" - assert_equal expected, last_response.body - else - assert_equal 404, last_response.status - end - end - test "reloads routes when configuration is changed in #{mode}" do controller :foo, <<-RUBY class FooController < ApplicationController |