diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2011-08-31 13:09:35 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2011-08-31 13:12:25 -0500 |
commit | 87074600d3f7909bce7884c4588aab83f1b3a2d1 (patch) | |
tree | 50c5041a32766e460e380d7f34c2a649f654d231 /railties/test/application | |
parent | d0b3937b8fe2cbc4385e843d47249af3e7181a83 (diff) | |
download | rails-87074600d3f7909bce7884c4588aab83f1b3a2d1.tar.gz rails-87074600d3f7909bce7884c4588aab83f1b3a2d1.tar.bz2 rails-87074600d3f7909bce7884c4588aab83f1b3a2d1.zip |
Fix asset debugging tests to reflect last changes in 3-1-stable
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/asset_debugging_test.rb | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/railties/test/application/asset_debugging_test.rb b/railties/test/application/asset_debugging_test.rb index 38e1e21d17..707abe7191 100644 --- a/railties/test/application/asset_debugging_test.rb +++ b/railties/test/application/asset_debugging_test.rb @@ -33,24 +33,33 @@ module ApplicationTests teardown_app end - test "assets are concatenated when debug is off and allow_debugging is off either if debug_assets param is provided" do - # config.assets.debug and config.assets.allow_debugging are false for production environment + test "assets are concatenated when debug is off and compile is off either if debug_assets param is provided" do + # config.assets.debug and config.assets.compile are false for production environment + ENV["RAILS_ENV"] = "production" + capture(:stdout) do + Dir.chdir(app_path){ `bundle exec rake assets:precompile` } + end require "#{app_path}/config/environment" - # the debug_assets params isn't used if allow_debugging is off + class ::PostsController < ActionController::Base ; end + + # the debug_assets params isn't used if compile is off get '/posts?debug_assets=true' - assert_match %r{<script src="/assets/application-([0-z]+)\.js" type="text/javascript"></script>}, last_response.body - assert_no_match %r{<script src="/assets/xmlhr-([0-z]+)\.js" type="text/javascript"></script>}, last_response.body + assert_match /<script src="\/assets\/application-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body + assert_no_match /<script src="\/assets\/xmlhr-([0-z]+)\.js" type="text\/javascript"><\/script>/, last_response.body end - test "assets aren't concatened when allow_debugging is on and debug_assets params is true" do - app_file "config/initializers/allow_debugging.rb", "Rails.application.config.assets.allow_debugging = true" + test "assets aren't concatened when compile is true is on and debug_assets params is true" do + app_file "config/initializers/compile.rb", "Rails.application.config.assets.compile = true" + ENV["RAILS_ENV"] = "production" require "#{app_path}/config/environment" + class ::PostsController < ActionController::Base ; end + get '/posts?debug_assets=true' - assert_match %r{<script src="/assets/application-([0-z]+)\.js\?body=1" type="text/javascript"></script>}, last_response.body - assert_match %r{<script src="/assets/xmlhr-([0-z]+)\.js\?body=1" type="text/javascript"></script>}, last_response.body + assert_match /<script src="\/assets\/application-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body + assert_match /<script src="\/assets\/xmlhr-([0-z]+)\.js\?body=1" type="text\/javascript"><\/script>/, last_response.body end end end |