diff options
author | Eric Allam <rubymaverick@gmail.com> | 2011-02-08 11:16:23 -0500 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2011-02-09 12:19:08 +0100 |
commit | d729e5f97e116a52ccd60232b728308cd08a367f (patch) | |
tree | e891d93b7579f85b82c16ec54e207ffea3067cf7 /railties/test | |
parent | 0faa7ee2a05b261ef89fb4652eaa0cfeef86c1d5 (diff) | |
download | rails-d729e5f97e116a52ccd60232b728308cd08a367f.tar.gz rails-d729e5f97e116a52ccd60232b728308cd08a367f.tar.bz2 rails-d729e5f97e116a52ccd60232b728308cd08a367f.zip |
Failing test for #6388
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/railties/engine_test.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 92aa025238..0ce00db3c4 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -306,6 +306,34 @@ module RailtiesTest assert_equal File.read(File.join(app_path, "public/bukkits/file_from_app.html")), last_response.body end + test "an applications files are given priority over an engines files when served via ActionDispatch::Static" do + add_to_config "config.serve_static_assets = true" + + @plugin.write "lib/bukkits.rb", <<-RUBY + class Bukkits + class Engine < ::Rails::Engine + engine_name :bukkits + end + end + RUBY + + app_file "config/routes.rb", <<-RUBY + AppTemplate::Application.routes.draw do + mount Bukkits::Engine => "/bukkits" + end + RUBY + + @plugin.write "public/bukkits.html", "in engine" + + app_file "public/bukkits/bukkits.html", "in app" + + boot_rails + + get('/bukkits/bukkits.html') + + assert_equal 'in app', last_response.body.strip + end + test "shared engine should include application's helpers and own helpers" do app_file "config/routes.rb", <<-RUBY AppTemplate::Application.routes.draw do |