diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-02-21 15:58:42 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-02-21 15:58:42 +0000 |
commit | 9b854c22b10992de25291ce1b69699618634ec72 (patch) | |
tree | 1dd991b80010a4d7a131886285cfdd66667325cd /actionpack/test | |
parent | 7f55931f80162937b344eb200ca62f2d58c6c59d (diff) | |
download | rails-9b854c22b10992de25291ce1b69699618634ec72.tar.gz rails-9b854c22b10992de25291ce1b69699618634ec72.tar.bz2 rails-9b854c22b10992de25291ce1b69699618634ec72.zip |
Added subdirectory test
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6188 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/asset_tag_helper_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb index 47a27e6e5d..71378584fa 100644 --- a/actionpack/test/template/asset_tag_helper_test.rb +++ b/actionpack/test/template/asset_tag_helper_test.rb @@ -211,11 +211,27 @@ class AssetTagHelperTest < Test::Unit::TestCase ) assert File.exists?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js')) + ensure File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js')) File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js')) end + def test_caching_javascript_include_tag_when_caching_on_and_using_subdirectory + ENV["RAILS_ASSET_ID"] = "" + ActionController::Base.asset_host = 'http://a%d.example.com' + ActionController::Base.perform_caching = true + + assert_dom_equal( + %(<script src="http://a3.example.com/javascripts/cache/money.js" type="text/javascript"></script>), + javascript_include_tag(:all, :cache => "cache/money") + ) + + assert File.exists?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'cache', 'money.js')) + ensure + File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'cache', 'money.js')) + end + def test_caching_javascript_include_tag_when_caching_off ENV["RAILS_ASSET_ID"] = "" ActionController::Base.perform_caching = false |