aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorMark J. Titorenko <mark@titorenko.net>2011-09-06 10:34:24 +0100
committerGuillermo Iguaran <guilleiguaran@gmail.com>2011-09-13 18:16:52 -0500
commitf22407dd34024886edd8a8f618dc0b19152776a0 (patch)
tree611ceb688c22315084ae3cb654d49ce83c64fa1a /railties/test
parent3b8a7cf2a7b2ffce671ca7f655de736c1054edbc (diff)
downloadrails-f22407dd34024886edd8a8f618dc0b19152776a0.tar.gz
rails-f22407dd34024886edd8a8f618dc0b19152776a0.tar.bz2
rails-f22407dd34024886edd8a8f618dc0b19152776a0.zip
Don't mount Sprockets at config.assets.prefix if config.assets.compile is false.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/assets_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb
index 9245532e17..0c40b88cf9 100644
--- a/railties/test/application/assets_test.rb
+++ b/railties/test/application/assets_test.rb
@@ -178,6 +178,7 @@ module ApplicationTests
test "assets do not require any assets group gem when manifest file is present" do
app_file "app/assets/javascripts/application.js", "alert();"
+ app_file "config/initializers/serve_static_assets.rb", "Rails.application.config.serve_static_assets = true"
ENV["RAILS_ENV"] = "production"
capture(:stdout) do
@@ -314,6 +315,17 @@ module ApplicationTests
assert_equal 0, files.length, "Expected no assets, but found #{files.join(', ')}"
end
+ test "assets routes are not drawn when compilation is disabled" do
+ app_file "app/assets/javascripts/demo.js.erb", "<%= :alert %>();"
+ app_file "config/initializers/compile.rb", "Rails.application.config.assets.compile = false"
+
+ ENV["RAILS_ENV"] = "production"
+ require "#{app_path}/config/environment"
+
+ get "/assets/demo.js"
+ assert_equal 404, last_response.status
+ end
+
test "does not stream session cookies back" do
app_file "app/assets/javascripts/demo.js.erb", "<%= :alert %>();"