re: RuboCop - replace rocket style hashes

This commit is contained in:
Alexey Dubovskoy
2016-06-20 20:58:50 +01:00
parent 004f1437d8
commit 024b2d51d3
19 changed files with 99 additions and 108 deletions

View File

@@ -54,7 +54,7 @@ module ActiveModel
adapter: :json_api
).serializable_hash
expected = {
:"comments-count" => @post.comments.count
"comments-count": @post.comments.count
}
assert_equal(expected, hash[:data][:meta])
end
@@ -68,9 +68,9 @@ module ActiveModel
adapter: :json_api
).serializable_hash
expected = {
:data => [
{ :id => '1337', :type => 'posts', :meta => { :"comments-count" => 0 } },
{ :id => '1339', :type => 'posts', :meta => { :"comments-count" => 1 } }
data: [
{ id: '1337', type: 'posts', meta: { "comments-count": 0 } },
{ id: '1339', type: 'posts', meta: { "comments-count": 1 } }
]
}
assert_equal(expected, hash)