diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-26 20:03:25 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-26 20:03:25 +0100 |
commit | 4999d52e08a02ebba344f6c318f0af4b5b18f0e5 (patch) | |
tree | f0d2af329fb961b6619ee5f2c21666168f8bb321 /railties/test | |
parent | 40b40c487040d9c721d486e8ec8cfbc53a8cd79a (diff) | |
download | rails-4999d52e08a02ebba344f6c318f0af4b5b18f0e5.tar.gz rails-4999d52e08a02ebba344f6c318f0af4b5b18f0e5.tar.bz2 rails-4999d52e08a02ebba344f6c318f0af4b5b18f0e5.zip |
Added that config/routes.rb files in engine plugins are automatically loaded (and reloaded when they change in dev mode) [DHH]
Diffstat (limited to 'railties/test')
6 files changed, 12 insertions, 1 deletions
diff --git a/railties/test/fixtures/plugins/engines/engine/app/controllers/engine_controller.rb b/railties/test/fixtures/plugins/engines/engine/app/controllers/engine_controller.rb new file mode 100644 index 0000000000..f08373de40 --- /dev/null +++ b/railties/test/fixtures/plugins/engines/engine/app/controllers/engine_controller.rb @@ -0,0 +1,2 @@ +class EngineController < ActionController::Base +end
\ No newline at end of file diff --git a/railties/test/fixtures/plugins/engines/engine/app/models/engine_model.rb b/railties/test/fixtures/plugins/engines/engine/app/models/engine_model.rb new file mode 100644 index 0000000000..e265712185 --- /dev/null +++ b/railties/test/fixtures/plugins/engines/engine/app/models/engine_model.rb @@ -0,0 +1,2 @@ +class EngineModel +end
\ No newline at end of file diff --git a/railties/test/fixtures/plugins/engines/engine/config/routes.rb b/railties/test/fixtures/plugins/engines/engine/config/routes.rb new file mode 100644 index 0000000000..cca8d1b146 --- /dev/null +++ b/railties/test/fixtures/plugins/engines/engine/config/routes.rb @@ -0,0 +1,3 @@ +ActionController::Routing::Routes.draw do |map| + map.connect '/engine', :controller => "engine" +end diff --git a/railties/test/fixtures/plugins/engines/engine/init.rb b/railties/test/fixtures/plugins/engines/engine/init.rb new file mode 100644 index 0000000000..f4b00c0fa4 --- /dev/null +++ b/railties/test/fixtures/plugins/engines/engine/init.rb @@ -0,0 +1,3 @@ +# My app/models dir must be in the load path. +require 'engine_model' +raise 'missing model from my app/models dir' unless defined?(EngineModel) diff --git a/railties/test/initializer_test.rb b/railties/test/initializer_test.rb index 88c267b58e..2104412c54 100644 --- a/railties/test/initializer_test.rb +++ b/railties/test/initializer_test.rb @@ -252,6 +252,7 @@ uses_mocha "Initializer plugin loading tests" do assert $LOAD_PATH.include?(File.join(plugin_fixture_path('default/acts/acts_as_chunky_bacon'), 'lib')) end + private def load_plugins! diff --git a/railties/test/plugin_locator_test.rb b/railties/test/plugin_locator_test.rb index 363fa27f15..5a8c651e5a 100644 --- a/railties/test/plugin_locator_test.rb +++ b/railties/test/plugin_locator_test.rb @@ -47,7 +47,7 @@ uses_mocha "Plugin Locator Tests" do end def test_should_return_all_plugins_found_under_the_set_plugin_paths - assert_equal ["a", "acts_as_chunky_bacon", "gemlike", "plugin_with_no_lib_dir", "stubby"].sort, @locator.plugins.map(&:name).sort + assert_equal ["a", "acts_as_chunky_bacon", "engine", "gemlike", "plugin_with_no_lib_dir", "stubby"].sort, @locator.plugins.map(&:name).sort end def test_should_find_plugins_only_under_the_plugin_paths_set_in_configuration |