0
@@ -392,6 +392,31 @@ class AssetTagHelperTest < ActionView::TestCase
0
FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'combined.js'))
0
+ def test_caching_javascript_include_tag_with_relative_url_root
0
+ ENV["RAILS_ASSET_ID"] = ""
0
+ ActionController::Base.relative_url_root = "/collaboration/hieraki"
0
+ ActionController::Base.perform_caching = true
0
+ %(<script src="/collaboration/hieraki/javascripts/all.js" type="text/javascript"></script>),
0
+ javascript_include_tag(:all, :cache => true)
0
+ assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js'))
0
+ %(<script src="/collaboration/hieraki/javascripts/money.js" type="text/javascript"></script>),
0
+ javascript_include_tag(:all, :cache => "money")
0
+ assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))
0
+ ActionController::Base.relative_url_root = nil
0
+ FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js'))
0
+ FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))
0
def test_caching_javascript_include_tag_when_caching_off
0
ENV["RAILS_ASSET_ID"] = ""
0
ActionController::Base.perform_caching = false
0
@@ -462,6 +487,31 @@ class AssetTagHelperTest < ActionView::TestCase
0
FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'styles.css'))
0
+ def test_caching_stylesheet_link_tag_with_relative_url_root
0
+ ENV["RAILS_ASSET_ID"] = ""
0
+ ActionController::Base.relative_url_root = "/collaboration/hieraki"
0
+ ActionController::Base.perform_caching = true
0
+ %(<link href="/collaboration/hieraki/stylesheets/all.css" media="screen" rel="stylesheet" type="text/css" />),
0
+ stylesheet_link_tag(:all, :cache => true)
0
+ expected = Dir["#{ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR}/*.css"].map { |p| File.mtime(p) }.max
0
+ assert_equal expected, File.mtime(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
0
+ %(<link href="/collaboration/hieraki/stylesheets/money.css" media="screen" rel="stylesheet" type="text/css" />),
0
+ stylesheet_link_tag(:all, :cache => "money")
0
+ assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
0
+ ActionController::Base.relative_url_root = nil
0
+ FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
0
+ FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
0
def test_caching_stylesheet_include_tag_when_caching_off
0
ENV["RAILS_ASSET_ID"] = ""
0
ActionController::Base.perform_caching = false