From 02c9654b9bdcd10ebd2c2ad9c50bbdf578a9aae0 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Mon, 6 Aug 2012 16:22:23 -0400 Subject: Do not include application.js if it doesn't exists Rails were including 'application.js' to the pack when using `javascript_include_tag :all` even there's no application.js in the public directory. --- actionpack/test/template/asset_tag_helper_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb index bcc55189b9..6a44197525 100644 --- a/actionpack/test/template/asset_tag_helper_test.rb +++ b/actionpack/test/template/asset_tag_helper_test.rb @@ -417,6 +417,15 @@ class AssetTagHelperTest < ActionView::TestCase assert_raise(ArgumentError) { javascript_include_tag(:defaults) } end + def test_all_javascript_expansion_not_include_application_js_if_not_exists + FileUtils.mv(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'application.js'), + File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'application.bak')) + assert_no_match(/application\.js/, javascript_include_tag(:all)) + ensure + FileUtils.mv(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'application.bak'), + File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'application.js')) + end + def test_stylesheet_path ENV["RAILS_ASSET_ID"] = "" StylePathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } -- cgit v1.2.3