mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
re: RuboCop - replace rocket style hashes
This commit is contained in:
@@ -143,12 +143,12 @@ module ActiveModel
|
||||
)
|
||||
actual = serializable(post, adapter: :attributes, serializer: InlineAssociationTestPostSerializer).as_json
|
||||
expected = {
|
||||
:comments => [
|
||||
{ :id => 1, :contents => 'first comment' },
|
||||
{ :id => 2, :contents => 'last comment' }
|
||||
comments: [
|
||||
{ id: 1, contents: 'first comment' },
|
||||
{ id: 2, contents: 'last comment' }
|
||||
],
|
||||
:last_comments => [
|
||||
{ :id => 2, :contents => 'last comment' }
|
||||
last_comments: [
|
||||
{ id: 2, contents: 'last comment' }
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ module ActiveModel
|
||||
inherited_klass = Class.new(AlternateBlogSerializer)
|
||||
blog_serializer = inherited_klass.new(@blog)
|
||||
adapter = ActiveModelSerializers::Adapter::Attributes.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
|
||||
|
||||
@@ -5,7 +5,7 @@ module ActiveModel
|
||||
class FieldsetTest < ActiveSupport::TestCase
|
||||
def test_fieldset_with_hash
|
||||
fieldset = ActiveModel::Serializer::Fieldset.new('post' => %w(id title), 'comment' => ['body'])
|
||||
expected = { :post => [:id, :title], :comment => [:body] }
|
||||
expected = { post: [:id, :title], comment: [:body] }
|
||||
|
||||
assert_equal(expected, fieldset.fields)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user