aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-26 15:46:17 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-26 15:46:17 +0100
commitd7de1c76cad28f52fc62693d415a07abf6c86ef5 (patch)
treedb5e08efe432ec23767f314b165aa5da3f013c33 /railties
parent081dfca33a7254ae86baa8feeb31f2c293b5f165 (diff)
downloadrails-d7de1c76cad28f52fc62693d415a07abf6c86ef5.tar.gz
rails-d7de1c76cad28f52fc62693d415a07abf6c86ef5.tar.bz2
rails-d7de1c76cad28f52fc62693d415a07abf6c86ef5.zip
Add a test which ensures application can overwrite plugins/engines view paths.
Diffstat (limited to 'railties')
-rw-r--r--railties/test/railties/shared_tests.rb19
1 files changed, 19 insertions, 0 deletions
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