re: RuboCop - get rid of redundant curly braces around a hash parameter

This commit is contained in:
Alexey Dubovskoy
2016-06-20 21:00:06 +01:00
parent 024b2d51d3
commit 13015680a7
12 changed files with 32 additions and 53 deletions

View File

@@ -7,10 +7,10 @@ module ActiveModel
@author = Author.new(name: 'Steve K.')
@author.bio = nil
@author.roles = []
@blog = Blog.new({ name: 'AMS Blog' })
@post = Post.new({ title: 'New Post', body: 'Body' })
@tag = Tag.new({ name: '#hashtagged' })
@comment = Comment.new({ id: 1, body: 'ZOMG A COMMENT' })
@blog = Blog.new(name: 'AMS Blog')
@post = Post.new(title: 'New Post', body: 'Body')
@tag = Tag.new(name: '#hashtagged')
@comment = Comment.new(id: 1, body: 'ZOMG A COMMENT')
@post.comments = [@comment]
@post.tags = [@tag]
@post.blog = @blog
@@ -19,7 +19,7 @@ module ActiveModel
@post.author = @author
@author.posts = [@post]
@post_serializer = PostSerializer.new(@post, { custom_options: true })
@post_serializer = PostSerializer.new(@post, custom_options: true)
@author_serializer = AuthorSerializer.new(@author)
@comment_serializer = CommentSerializer.new(@comment)
end

View File

@@ -4,7 +4,7 @@ module ActiveModel
class Serializer
class AttributesTest < ActiveSupport::TestCase
def setup
@profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' })
@profile = Profile.new(name: 'Name 1', description: 'Description 1', comments: 'Comments 1')
@profile_serializer = ProfileSerializer.new(@profile)
@comment = Comment.new(id: 1, body: 'ZOMG!!', date: '2015')
@serializer_klass = Class.new(CommentSerializer)

View File

@@ -8,7 +8,7 @@ module ActiveModel
end
def test_overwrite_root
serializer = VirtualValueSerializer.new(@virtual_value, { root: 'smth' })
serializer = VirtualValueSerializer.new(@virtual_value, root: 'smth')
assert_equal('smth', serializer.json_key)
end