aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/asset_tag_helper_test.rb
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2012-08-06 16:22:23 -0400
committerPrem Sichanugrist <s@sikachu.com>2012-08-06 16:38:52 -0400
commit8e2a05b33da1cd27d18a82168b49ba642122fbdb (patch)
tree54ef512f02d6496ecb595eac38379a3e74d311f7 /actionpack/test/template/asset_tag_helper_test.rb
parent0fb6bbdf7e708691ab3ed320868b7bcebfc68885 (diff)
downloadrails-8e2a05b33da1cd27d18a82168b49ba642122fbdb.tar.gz
rails-8e2a05b33da1cd27d18a82168b49ba642122fbdb.tar.bz2
rails-8e2a05b33da1cd27d18a82168b49ba642122fbdb.zip
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.
Diffstat (limited to 'actionpack/test/template/asset_tag_helper_test.rb')
-rw-r--r--actionpack/test/template/asset_tag_helper_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb
index 6a0fdf0590..b1a01b53b1 100644
--- a/actionpack/test/template/asset_tag_helper_test.rb
+++ b/actionpack/test/template/asset_tag_helper_test.rb
@@ -338,6 +338,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)) }