From d7de1c76cad28f52fc62693d415a07abf6c86ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 26 Jan 2010 15:46:17 +0100 Subject: Add a test which ensures application can overwrite plugins/engines view paths. --- railties/test/railties/shared_tests.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'railties/test') diff --git a/railties/test/railties/shared_tests.rb b/railties/test/railties/shared_tests.rb index a20aa5e4f5..fc4a19e7e7 100644 --- a/railties/test/railties/shared_tests.rb +++ b/railties/test/railties/shared_tests.rb @@ -72,6 +72,25 @@ module RailtiesTest assert_equal "Hello bukkits\n", response[2].body end + def test_plugin_adds_its_views_to_view_paths_with_lower_proriority + @plugin.write "app/controllers/bukkit_controller.rb", <<-RUBY + class BukkitController < ActionController::Base + def index + end + end + RUBY + + @plugin.write "app/views/bukkit/index.html.erb", "Hello bukkits" + app_file "app/views/bukkit/index.html.erb", "Hi bukkits" + + boot_rails + + require "action_controller" + require "rack/mock" + response = BukkitController.action(:index).call(Rack::MockRequest.env_for("/")) + assert_equal "Hi bukkits\n", response[2].body + end + def test_plugin_adds_helpers_to_controller_views @plugin.write "app/controllers/bukkit_controller.rb", <<-RUBY class BukkitController < ActionController::Base -- cgit v1.2.3