aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-07-08 00:58:14 +0200
committerXavier Noria <fxn@hashref.com>2011-07-08 00:58:14 +0200
commitad912c08a91b90f6a7b30ae75b4a3a5f6c513bd4 (patch)
tree65d20f47dc4f2c08af7368100f859aa38eb34084 /actionpack/test
parente01aba15043fabf937bd6dbb818b6bce9a90651a (diff)
downloadrails-ad912c08a91b90f6a7b30ae75b4a3a5f6c513bd4.tar.gz
rails-ad912c08a91b90f6a7b30ae75b4a3a5f6c513bd4.tar.bz2
rails-ad912c08a91b90f6a7b30ae75b4a3a5f6c513bd4.zip
use Zlib.crc2 rather that bytes.sum, as per Aaron's suggestion
That integer is rather irrelevant, the only thing that matters is that it is consistent and with no apparent bias. Zlib.crc32 is 8-10 times faster than bytes.sum, so use that.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/asset_tag_helper_test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb
index 717e0e9065..d5bd7256f7 100644
--- a/actionpack/test/template/asset_tag_helper_test.rb
+++ b/actionpack/test/template/asset_tag_helper_test.rb
@@ -1,3 +1,4 @@
+require 'zlib'
require 'abstract_unit'
require 'active_support/ordered_options'
@@ -689,7 +690,7 @@ class AssetTagHelperTest < ActionView::TestCase
@controller.config.asset_host = 'http://a%d.example.com'
config.perform_caching = true
- number = '/javascripts/cache/money.js'.bytes.sum % 4
+ number = Zlib.crc32('/javascripts/cache/money.js') % 4
assert_dom_equal(
%(<script src="http://a#{number}.example.com/javascripts/cache/money.js" type="text/javascript"></script>),
javascript_include_tag(:all, :cache => "cache/money")