diff options
author | Prem Sichanugrist <s@sikachu.com> | 2012-08-06 16:22:23 -0400 |
---|---|---|
committer | Prem Sichanugrist <s@sikachu.com> | 2012-08-06 16:45:10 -0400 |
commit | 02c9654b9bdcd10ebd2c2ad9c50bbdf578a9aae0 (patch) | |
tree | ce47c9a0f6321881004ad92c77cdcea7ae30196e /actionpack/test | |
parent | 02d31841bcf317d79925ca82dcc1bbf9079dc659 (diff) | |
download | rails-02c9654b9bdcd10ebd2c2ad9c50bbdf578a9aae0.tar.gz rails-02c9654b9bdcd10ebd2c2ad9c50bbdf578a9aae0.tar.bz2 rails-02c9654b9bdcd10ebd2c2ad9c50bbdf578a9aae0.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')
-rw-r--r-- | actionpack/test/template/asset_tag_helper_test.rb | 9 |
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 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)) } |