Style/StringLiterals single quote all the things

This commit is contained in:
Benjamin Fleischer
2015-08-30 23:20:25 -05:00
parent 09c97de90d
commit bdfe13c527
36 changed files with 347 additions and 347 deletions

View File

@@ -4,7 +4,7 @@ module ActiveModel
class Serializer
class AttributeTest < Minitest::Test
def setup
@blog = Blog.new({ id: 1, name: 'AMS Hints', type: "stuff" })
@blog = Blog.new({ id: 1, name: 'AMS Hints', type: 'stuff' })
@blog_serializer = AlternateBlogSerializer.new(@blog)
end
@@ -15,14 +15,14 @@ module ActiveModel
def test_json_serializable_hash
adapter = ActiveModel::Serializer::Adapter::Json.new(@blog_serializer)
assert_equal({blog: { id:1, title:"AMS Hints"}}, adapter.serializable_hash)
assert_equal({blog: { id:1, title:'AMS Hints'}}, adapter.serializable_hash)
end
def test_attribute_inheritance_with_key
inherited_klass = Class.new(AlternateBlogSerializer)
blog_serializer = inherited_klass.new(@blog)
adapter = ActiveModel::Serializer::Adapter::FlattenJson.new(blog_serializer)
assert_equal({:id=>1, :title=>"AMS Hints"}, adapter.serializable_hash)
assert_equal({:id=>1, :title=>'AMS Hints'}, adapter.serializable_hash)
end
def test_multiple_calls_with_the_same_attribute
@@ -40,7 +40,7 @@ module ActiveModel
end
adapter = ActiveModel::Serializer::Adapter::Json.new(serializer.new(@blog))
assert_equal({ blog: { id: "AMS Hints" } }, adapter.serializable_hash)
assert_equal({ blog: { id: 'AMS Hints' } }, adapter.serializable_hash)
end
def test_type_attribute
@@ -55,7 +55,7 @@ module ActiveModel
assert_equal({ blog: { type: 1} }, adapter.serializable_hash)
adapter = ActiveModel::Serializer::Adapter::Json.new(attributes_serializer.new(@blog))
assert_equal({ blog: { type: "stuff" } }, adapter.serializable_hash)
assert_equal({ blog: { type: 'stuff' } }, adapter.serializable_hash)
end
end
end