aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAlbert Callarisa Roca <shark234@gmail.com>2011-07-08 00:10:20 +0800
committerAlbert Callarisa Roca <shark234@gmail.com>2011-07-08 00:10:20 +0800
commitf6a6b51ae551b7f936e974cba3ad4b30422d6804 (patch)
tree67544eb205101644849952af0e404d3ed99361d4 /actionpack/test
parent298a0834e181c63e5c1165a11efa1f6947b536f2 (diff)
downloadrails-f6a6b51ae551b7f936e974cba3ad4b30422d6804.tar.gz
rails-f6a6b51ae551b7f936e974cba3ad4b30422d6804.tar.bz2
rails-f6a6b51ae551b7f936e974cba3ad4b30422d6804.zip
Using the sum of bytes instead the hash of the path when replacing the wildcard of the assets path because in ruby 1.9 is not consistent
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/asset_tag_helper_test.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb
index df61901b44..59e7ac144b 100644
--- a/actionpack/test/template/asset_tag_helper_test.rb
+++ b/actionpack/test/template/asset_tag_helper_test.rb
@@ -689,9 +689,9 @@ class AssetTagHelperTest < ActionView::TestCase
@controller.config.asset_host = 'http://a%d.example.com'
config.perform_caching = true
- hash = '/javascripts/cache/money.js'.hash % 4
+ number = '/javascripts/cache/money.js'.bytes.sum % 4
assert_dom_equal(
- %(<script src="http://a#{hash}.example.com/javascripts/cache/money.js" type="text/javascript"></script>),
+ %(<script src="http://a#{number}.example.com/javascripts/cache/money.js" type="text/javascript"></script>),
javascript_include_tag(:all, :cache => "cache/money")
)
@@ -1129,6 +1129,7 @@ class AssetTagHelperNonVhostTest < ActionView::TestCase
end
def test_should_wildcard_asset_host_between_zero_and_four
+ String.any_instance.expects(:hash).times(0)
@controller.config.asset_host = 'http://a%d.example.com'
assert_match(%r(http://a[0123].example.com/collaboration/hieraki/images/xml.png), image_path('xml.png'))
end