Rails 1.9 compat: asset tag helper tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8470 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
99664d5444
commit
0333190d1a
|
@ -225,7 +225,7 @@ class AssetTagHelperTest < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_caching_javascript_include_tag_when_caching_on
|
def test_caching_javascript_include_tag_when_caching_on
|
||||||
ENV["RAILS_ASSET_ID"] = ""
|
ENV["RAILS_ASSET_ID"] = ""
|
||||||
ActionController::Base.asset_host = 'http://a%d.example.com'
|
ActionController::Base.asset_host = 'http://a0.example.com'
|
||||||
ActionController::Base.perform_caching = true
|
ActionController::Base.perform_caching = true
|
||||||
|
|
||||||
assert_dom_equal(
|
assert_dom_equal(
|
||||||
|
@ -236,15 +236,15 @@ class AssetTagHelperTest < Test::Unit::TestCase
|
||||||
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js'))
|
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js'))
|
||||||
|
|
||||||
assert_dom_equal(
|
assert_dom_equal(
|
||||||
%(<script src="http://a2.example.com/javascripts/money.js" type="text/javascript"></script>),
|
%(<script src="http://a0.example.com/javascripts/money.js" type="text/javascript"></script>),
|
||||||
javascript_include_tag(:all, :cache => "money")
|
javascript_include_tag(:all, :cache => "money")
|
||||||
)
|
)
|
||||||
|
|
||||||
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))
|
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))
|
||||||
|
|
||||||
ensure
|
ensure
|
||||||
File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js'))
|
FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js'))
|
||||||
File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))
|
FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_caching_javascript_include_tag_when_caching_on_with_proc_asset_host
|
def test_caching_javascript_include_tag_when_caching_on_with_proc_asset_host
|
||||||
|
@ -261,7 +261,7 @@ class AssetTagHelperTest < Test::Unit::TestCase
|
||||||
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'scripts.js'))
|
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'scripts.js'))
|
||||||
|
|
||||||
ensure
|
ensure
|
||||||
File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'scripts.js'))
|
FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'scripts.js'))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_caching_javascript_include_tag_when_caching_on_and_using_subdirectory
|
def test_caching_javascript_include_tag_when_caching_on_and_using_subdirectory
|
||||||
|
@ -276,7 +276,7 @@ class AssetTagHelperTest < Test::Unit::TestCase
|
||||||
|
|
||||||
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'cache', 'money.js'))
|
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'cache', 'money.js'))
|
||||||
ensure
|
ensure
|
||||||
File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'cache', 'money.js'))
|
FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'cache', 'money.js'))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_caching_javascript_include_tag_when_caching_off
|
def test_caching_javascript_include_tag_when_caching_off
|
||||||
|
@ -300,25 +300,25 @@ class AssetTagHelperTest < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_caching_stylesheet_link_tag_when_caching_on
|
def test_caching_stylesheet_link_tag_when_caching_on
|
||||||
ENV["RAILS_ASSET_ID"] = ""
|
ENV["RAILS_ASSET_ID"] = ""
|
||||||
ActionController::Base.asset_host = 'http://a%d.example.com'
|
ActionController::Base.asset_host = 'http://a0.example.com'
|
||||||
ActionController::Base.perform_caching = true
|
ActionController::Base.perform_caching = true
|
||||||
|
|
||||||
assert_dom_equal(
|
assert_dom_equal(
|
||||||
%(<link href="http://a3.example.com/stylesheets/all.css" media="screen" rel="stylesheet" type="text/css" />),
|
%(<link href="http://a0.example.com/stylesheets/all.css" media="screen" rel="stylesheet" type="text/css" />),
|
||||||
stylesheet_link_tag(:all, :cache => true)
|
stylesheet_link_tag(:all, :cache => true)
|
||||||
)
|
)
|
||||||
|
|
||||||
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
|
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
|
||||||
|
|
||||||
assert_dom_equal(
|
assert_dom_equal(
|
||||||
%(<link href="http://a3.example.com/stylesheets/money.css" media="screen" rel="stylesheet" type="text/css" />),
|
%(<link href="http://a0.example.com/stylesheets/money.css" media="screen" rel="stylesheet" type="text/css" />),
|
||||||
stylesheet_link_tag(:all, :cache => "money")
|
stylesheet_link_tag(:all, :cache => "money")
|
||||||
)
|
)
|
||||||
|
|
||||||
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
|
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
|
||||||
ensure
|
ensure
|
||||||
File.delete(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
|
FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
|
||||||
File.delete(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
|
FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_caching_stylesheet_link_tag_when_caching_on_with_proc_asset_host
|
def test_caching_stylesheet_link_tag_when_caching_on_with_proc_asset_host
|
||||||
|
@ -335,7 +335,7 @@ class AssetTagHelperTest < Test::Unit::TestCase
|
||||||
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'styles.css'))
|
assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'styles.css'))
|
||||||
|
|
||||||
ensure
|
ensure
|
||||||
File.delete(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'styles.css'))
|
FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'styles.css'))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_caching_stylesheet_include_tag_when_caching_off
|
def test_caching_stylesheet_include_tag_when_caching_off
|
||||||
|
|
Loading…
Reference in New Issue