From 827cdae6fb5e21056b68ab8a89047ae82738871f Mon Sep 17 00:00:00 2001 From: Guillermo Iguaran Date: Mon, 22 Aug 2011 23:19:25 -0500 Subject: Add config.allow_debugging option to determine if the debug_assets query param can be passed by user --- railties/test/application/assets_test.rb | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'railties/test/application') diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index a8d1382e94..1e6a93dbdf 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -135,5 +135,47 @@ module ApplicationTests assert_match "alert();", last_response.body assert_equal 200, last_response.status end + + test "assets are concatenated when debug is off and allow_debugging is off either if debug_assets param is provided" do + app_with_assets_in_view + + # config.assets.debug and config.assets.allow_debugging are false for production environment + ENV["RAILS_ENV"] = "production" + require "#{app_path}/config/environment" + + class ::PostsController < ActionController::Base ; end + + # the debug_assets params isn't used if allow_debugging is off + get '/posts?debug_assets=true' + assert_match /