aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-06-29 17:39:50 +0200
committerJosé Valim <jose.valim@gmail.com>2012-06-29 17:44:10 +0200
commit5e7d6bba79393de0279917f93b82f3b7b176f4b5 (patch)
tree1e9c6c8c183ba326efa33087d9b590c9196acec3 /railties/test
parent50b6110106a6e467f5e5f6303700522cebc60a9c (diff)
downloadrails-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')
-rw-r--r--railties/test/application/paths_test.rb2
-rw-r--r--railties/test/application/routing_test.rb83
-rw-r--r--railties/test/paths_test.rb2
3 files changed, 0 insertions, 87 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
diff --git a/railties/test/paths_test.rb b/railties/test/paths_test.rb
index 5d6b6f9f72..d334034e7d 100644
--- a/railties/test/paths_test.rb
+++ b/railties/test/paths_test.rb
@@ -29,7 +29,6 @@ class PathsTest < ActiveSupport::TestCase
test "creating a root level path" do
@root.add "app"
assert_equal ["/foo/bar/app"], @root["app"].to_a
- assert_equal ["/foo/bar/app"], @root["app"].paths
end
test "creating a root level path with options" do
@@ -192,7 +191,6 @@ class PathsTest < ActiveSupport::TestCase
@root["app"] = "/app"
@root["app"].glob = "*.rb"
assert_equal "*.rb", @root["app"].glob
- assert_equal ["/foo/bar/app"], @root["app"].paths
end
test "it should be possible to override a path's default glob without assignment" do