diff options
author | Andrew Kaspick <andrew@redlinesoftware.com> | 2009-06-04 22:50:41 -0500 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2009-06-11 16:33:32 +1200 |
commit | 59c83af18b1a9189f82b9c5408cd1bad35a11eb2 (patch) | |
tree | 2a6aefdad980c43e05ac1bd42571edf456041b47 /actionpack/test/template | |
parent | 47ff57f6d14fe161900bf85e2d2cf6d7e21a1eb8 (diff) | |
download | rails-59c83af18b1a9189f82b9c5408cd1bad35a11eb2.tar.gz rails-59c83af18b1a9189f82b9c5408cd1bad35a11eb2.tar.bz2 rails-59c83af18b1a9189f82b9c5408cd1bad35a11eb2.zip |
allow absolute paths for the asset caches
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'actionpack/test/template')
-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 76ceff8d6c..d586afdef6 100644 --- a/actionpack/test/template/asset_tag_helper_test.rb +++ b/actionpack/test/template/asset_tag_helper_test.rb @@ -317,9 +317,17 @@ class AssetTagHelperTest < ActionView::TestCase assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js')) + assert_dom_equal( + %(<script src="http://a0.example.com/absolute/test.js" type="text/javascript"></script>), + javascript_include_tag(:all, :cache => "/absolute/test") + ) + + assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::ASSETS_DIR, 'absolute', 'test.js')) + ensure FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js')) FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js')) + FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::ASSETS_DIR, 'absolute')) end def test_caching_javascript_include_tag_when_caching_on_with_proc_asset_host @@ -547,9 +555,17 @@ class AssetTagHelperTest < ActionView::TestCase ) assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css')) + + assert_dom_equal( + %(<link href="http://a0.example.com/absolute/test.css" media="screen" rel="stylesheet" type="text/css" />), + stylesheet_link_tag(:all, :cache => "/absolute/test") + ) + + assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::ASSETS_DIR, 'absolute', 'test.css')) ensure FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css')) FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css')) + FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::ASSETS_DIR, 'absolute')) end def test_caching_stylesheet_link_tag_when_caching_on_with_proc_asset_host |