aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/asset_tag_helper_test.rb
diff options
context:
space:
mode:
authorDenis Odorcic <denis.odorcic@gmail.com>2010-03-11 00:47:10 -0500
committerJosé Valim <jose.valim@gmail.com>2010-03-12 21:33:39 +0100
commite484d4ae5684b9ca49b27a844bf48c91c945814e (patch)
treec4f2473fd3e9ec49cbe6fc48ab340159f68148e8 /actionpack/test/template/asset_tag_helper_test.rb
parentb8f7ba293567d7dcc4a89d4722b26b7ca8552cae (diff)
downloadrails-e484d4ae5684b9ca49b27a844bf48c91c945814e.tar.gz
rails-e484d4ae5684b9ca49b27a844bf48c91c945814e.tar.bz2
rails-e484d4ae5684b9ca49b27a844bf48c91c945814e.zip
Made asset_tag_helper use config.perform_caching instead of ActionController::Base.perform_caching
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test/template/asset_tag_helper_test.rb')
-rw-r--r--actionpack/test/template/asset_tag_helper_test.rb36
1 files changed, 18 insertions, 18 deletions
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb
index d9a89959da..d36a763876 100644
--- a/actionpack/test/template/asset_tag_helper_test.rb
+++ b/actionpack/test/template/asset_tag_helper_test.rb
@@ -50,7 +50,7 @@ class AssetTagHelperTest < ActionView::TestCase
end
def teardown
- ActionController::Base.perform_caching = false
+ config.perform_caching = false
ENV.delete('RAILS_ASSET_ID')
end
@@ -422,7 +422,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_javascript_include_tag_when_caching_on
ENV["RAILS_ASSET_ID"] = ""
@controller.config.asset_host = 'http://a0.example.com'
- ActionController::Base.perform_caching = true
+ config.perform_caching = true
assert_dom_equal(
%(<script src="http://a0.example.com/javascripts/all.js" type="text/javascript"></script>),
@@ -454,7 +454,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_javascript_include_tag_when_caching_on_with_proc_asset_host
ENV['RAILS_ASSET_ID'] = ''
@controller.config.asset_host = Proc.new { |source| "http://a#{source.length}.example.com" }
- ActionController::Base.perform_caching = true
+ config.perform_caching = true
assert_equal '/javascripts/scripts.js'.length, 23
assert_dom_equal(
@@ -477,7 +477,7 @@ class AssetTagHelperTest < ActionView::TestCase
"#{request.protocol}assets#{source.length}.example.com"
end
}
- ActionController::Base.perform_caching = true
+ config.perform_caching = true
assert_equal '/javascripts/vanilla.js'.length, 23
assert_dom_equal(
@@ -517,7 +517,7 @@ class AssetTagHelperTest < ActionView::TestCase
end
end.new
- ActionController::Base.perform_caching = true
+ config.perform_caching = true
assert_equal '/javascripts/vanilla.js'.length, 23
assert_dom_equal(
@@ -548,7 +548,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_javascript_include_tag_when_caching_on_and_using_subdirectory
ENV["RAILS_ASSET_ID"] = ""
@controller.config.asset_host = 'http://a%d.example.com'
- ActionController::Base.perform_caching = true
+ config.perform_caching = true
hash = '/javascripts/cache/money.js'.hash % 4
assert_dom_equal(
@@ -564,7 +564,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_javascript_include_tag_with_all_and_recursive_puts_defaults_at_the_start_of_the_file
ENV["RAILS_ASSET_ID"] = ""
@controller.config.asset_host = 'http://a0.example.com'
- ActionController::Base.perform_caching = true
+ config.perform_caching = true
assert_dom_equal(
%(<script src="http://a0.example.com/javascripts/combined.js" type="text/javascript"></script>),
@@ -585,7 +585,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_javascript_include_tag_with_all_puts_defaults_at_the_start_of_the_file
ENV["RAILS_ASSET_ID"] = ""
@controller.config.asset_host = 'http://a0.example.com'
- ActionController::Base.perform_caching = true
+ config.perform_caching = true
assert_dom_equal(
%(<script src="http://a0.example.com/javascripts/combined.js" type="text/javascript"></script>),
@@ -606,7 +606,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_javascript_include_tag_with_relative_url_root
ENV["RAILS_ASSET_ID"] = ""
@controller.config.relative_url_root = "/collaboration/hieraki"
- ActionController::Base.perform_caching = true
+ config.perform_caching = true
assert_dom_equal(
%(<script src="/collaboration/hieraki/javascripts/all.js" type="text/javascript"></script>),
@@ -629,7 +629,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_javascript_include_tag_when_caching_off
ENV["RAILS_ASSET_ID"] = ""
- ActionController::Base.perform_caching = false
+ config.perform_caching = false
assert_dom_equal(
%(<script src="/javascripts/prototype.js" type="text/javascript"></script>\n<script src="/javascripts/effects.js" type="text/javascript"></script>\n<script src="/javascripts/dragdrop.js" type="text/javascript"></script>\n<script src="/javascripts/controls.js" type="text/javascript"></script>\n<script src="/javascripts/application.js" type="text/javascript"></script>\n<script src="/javascripts/bank.js" type="text/javascript"></script>\n<script src="/javascripts/robber.js" type="text/javascript"></script>\n<script src="/javascripts/version.1.0.js" type="text/javascript"></script>),
@@ -658,7 +658,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_javascript_include_tag_when_caching_on_and_missing_javascript_file
ENV["RAILS_ASSET_ID"] = ""
- ActionController::Base.perform_caching = true
+ config.perform_caching = true
assert_raise(Errno::ENOENT) {
javascript_include_tag('bank', 'robber', 'missing_security_guard', :cache => true)
@@ -675,7 +675,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_javascript_include_tag_when_caching_off_and_missing_javascript_file
ENV["RAILS_ASSET_ID"] = ""
- ActionController::Base.perform_caching = false
+ config.perform_caching = false
assert_raise(Errno::ENOENT) {
javascript_include_tag('bank', 'robber', 'missing_security_guard', :cache => true)
@@ -693,7 +693,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_stylesheet_link_tag_when_caching_on
ENV["RAILS_ASSET_ID"] = ""
@controller.config.asset_host = 'http://a0.example.com'
- ActionController::Base.perform_caching = true
+ config.perform_caching = true
assert_dom_equal(
%(<link href="http://a0.example.com/stylesheets/all.css" media="screen" rel="stylesheet" type="text/css" />),
@@ -760,7 +760,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_stylesheet_link_tag_when_caching_on_and_missing_css_file
ENV["RAILS_ASSET_ID"] = ""
- ActionController::Base.perform_caching = true
+ config.perform_caching = true
assert_raise(Errno::ENOENT) {
stylesheet_link_tag('bank', 'robber', 'missing_security_guard', :cache => true)
@@ -781,7 +781,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_stylesheet_link_tag_when_caching_off_and_missing_css_file
ENV["RAILS_ASSET_ID"] = ""
- ActionController::Base.perform_caching = false
+ config.perform_caching = false
assert_raise(Errno::ENOENT) {
stylesheet_link_tag('bank', 'robber', 'missing_security_guard', :cache => true)
@@ -803,7 +803,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_stylesheet_link_tag_when_caching_on_with_proc_asset_host
ENV["RAILS_ASSET_ID"] = ""
@controller.config.asset_host = Proc.new { |source| "http://a#{source.length}.example.com" }
- ActionController::Base.perform_caching = true
+ config.perform_caching = true
assert_equal '/stylesheets/styles.css'.length, 23
assert_dom_equal(
@@ -820,7 +820,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_stylesheet_link_tag_with_relative_url_root
ENV["RAILS_ASSET_ID"] = ""
@controller.config.relative_url_root = "/collaboration/hieraki"
- ActionController::Base.perform_caching = true
+ config.perform_caching = true
assert_dom_equal(
%(<link href="/collaboration/hieraki/stylesheets/all.css" media="screen" rel="stylesheet" type="text/css" />),
@@ -845,7 +845,7 @@ class AssetTagHelperTest < ActionView::TestCase
def test_caching_stylesheet_include_tag_when_caching_off
ENV["RAILS_ASSET_ID"] = ""
- ActionController::Base.perform_caching = false
+ config.perform_caching = false
assert_dom_equal(
%(<link href="/stylesheets/bank.css" media="screen" rel="stylesheet" type="text/css" />\n<link href="/stylesheets/robber.css" media="screen" rel="stylesheet" type="text/css" />\n<link href="/stylesheets/version.1.0.css" media="screen" rel="stylesheet" type="text/css" />),