aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-02-21 15:58:42 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-02-21 15:58:42 +0000
commit9b854c22b10992de25291ce1b69699618634ec72 (patch)
tree1dd991b80010a4d7a131886285cfdd66667325cd /actionpack
parent7f55931f80162937b344eb200ca62f2d58c6c59d (diff)
downloadrails-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')
-rw-r--r--actionpack/test/template/asset_tag_helper_test.rb16
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