Fix warnings

JRuby-specific: fix 'warning: (...) interpreted as grouped expression'
This commit is contained in:
Benjamin Fleischer
2015-08-21 02:23:37 -04:00
parent 9aad8b4d29
commit d315151e8a
16 changed files with 77 additions and 54 deletions

View File

@@ -81,7 +81,7 @@ module ActiveModel
def test_serializer_options_are_passed_into_associations_serializers
association = @post_serializer
.associations
.detect { |association| association.key == :comments }
.detect { |assoc| assoc.key == :comments }
assert association.serializer.first.custom_options[:custom_options]
end

View File

@@ -47,13 +47,13 @@ module ActiveModel
end
def test_cache_key_interpolation_with_updated_at
author = render_object_with_cache(@author)
render_object_with_cache(@author)
assert_equal(nil, ActionController::Base.cache_store.fetch(@author.cache_key))
assert_equal(@author_serializer.attributes.to_json, ActionController::Base.cache_store.fetch("#{@author_serializer.class._cache_key}/#{@author_serializer.object.id}-#{@author_serializer.object.updated_at.strftime("%Y%m%d%H%M%S%9N")}").to_json)
end
def test_default_cache_key_fallback
comment = render_object_with_cache(@comment)
render_object_with_cache(@comment)
assert_equal(@comment_serializer.attributes.to_json, ActionController::Base.cache_store.fetch(@comment.cache_key).to_json)
end
@@ -74,7 +74,7 @@ module ActiveModel
assert_equal(nil, ActionController::Base.cache_store.fetch(@comment.cache_key))
Timecop.freeze(Time.now) do
post = render_object_with_cache(@post)
render_object_with_cache(@post)
assert_equal(@post_serializer.attributes, ActionController::Base.cache_store.fetch(@post.cache_key))
assert_equal(@comment_serializer.attributes, ActionController::Base.cache_store.fetch(@comment.cache_key))
@@ -122,7 +122,7 @@ module ActiveModel
end
def test_uses_file_digest_in_cache_key
blog = render_object_with_cache(@blog)
render_object_with_cache(@blog)
assert_equal(@blog_serializer.attributes, ActionController::Base.cache_store.fetch(@blog.cache_key_with_digest))
end