aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2010-09-07 22:59:09 +0200
committerPiotr Sarnacki <drogus@gmail.com>2010-09-10 17:20:16 +0200
commit497b6af8818f656fdbca9ed2470c1c16ae5ff1cd (patch)
treef0bad3e6f3ca8c44c96e1238c097261a067a030c /railties/test
parent36fcb776dda9a3dd0839febd0a4663320d1944db (diff)
downloadrails-497b6af8818f656fdbca9ed2470c1c16ae5ff1cd.tar.gz
rails-497b6af8818f656fdbca9ed2470c1c16ae5ff1cd.tar.bz2
rails-497b6af8818f656fdbca9ed2470c1c16ae5ff1cd.zip
Set default asset_path only for engine
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/railties/engine_test.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb
index 370f9342e3..6fc166e054 100644
--- a/railties/test/railties/engine_test.rb
+++ b/railties/test/railties/engine_test.rb
@@ -281,6 +281,34 @@ module RailtiesTest
assert_equal expected, stripped_body
end
+ test "default application's asset_path" do
+ @plugin.write "config/routes.rb", <<-RUBY
+ Bukkits::Engine.routes.draw do
+ match "/foo" => "foo#index"
+ end
+ RUBY
+
+ @plugin.write "app/controllers/foo_controller.rb", <<-RUBY
+ class FooController < ActionController::Base
+ def index
+ end
+ end
+ RUBY
+
+ @plugin.write "app/views/foo/index.html.erb", <<-RUBY
+ <%= compute_public_path("/foo", "") %>
+ RUBY
+
+ boot_rails
+
+ env = Rack::MockRequest.env_for("/foo")
+ response = Bukkits::Engine.call(env)
+ stripped_body = response[2].body.strip
+
+ expected = "/bukkits/foo"
+ assert_equal expected, stripped_body
+ end
+
test "engine's files are served via ActionDispatch::Static" do
add_to_config "config.serve_static_assets = true"