diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-07-29 16:23:15 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-03 22:59:09 +0200 |
commit | 937f41919c6033272b40b147f7ac5e888207ac89 (patch) | |
tree | ea2716296619f713aba94507a124a489b5cff00a /railties/test | |
parent | 401cd97923fb52c8f8c458b8cb276b338e0b20f3 (diff) | |
download | rails-937f41919c6033272b40b147f7ac5e888207ac89.tar.gz rails-937f41919c6033272b40b147f7ac5e888207ac89.tar.bz2 rails-937f41919c6033272b40b147f7ac5e888207ac89.zip |
Engine's assets are now served with ActionDispatch::Static
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/railties/engine_test.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 788bc77620..d4ecdf4742 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -273,5 +273,30 @@ module RailtiesTest "<link href=\"/omg/bukkits/stylesheets/foo.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />" assert_equal expected, stripped_body end + + test "engine's files are 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 + + @plugin.write "public/bukkits.html", "/bukkits/bukkits.html" + app_file "public/app.html", "/app.html" + + boot_rails + + env = Rack::MockRequest.env_for("/app.html") + response = Rails.application.call(env) + assert_equal response[2].path, File.join(app_path, "public/app.html") + + env = Rack::MockRequest.env_for("/bukkits/bukkits.html") + response = Rails.application.call(env) + assert_equal response[2].path, File.join(@plugin.path, "public/bukkits.html") + end end end |