Skip to content

Commit 238d792

Browse files
committed
Lint per rubocop
1 parent b358271 commit 238d792

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/serializers/reflection_test.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -448,28 +448,28 @@ class PostSerializer < ActiveModel::Serializer
448448

449449
# per https://github.com/rails-api/active_model_serializers/issues/2270
450450
def test_concurrent_serialization
451-
post1 = Post.new(id: 1, title: "Post 1 Title", body: "Post 1 Body")
452-
post1.comments = [Comment.new(id: 1, body: "Comment on Post 1", post: post1)]
453-
post2 = Post.new(id: 2, title: "Post 2 Title", body: "Post 2 Body")
454-
post2.comments = [Comment.new(id: 2, body: "Comment on Post 2", post: post2)]
451+
post1 = Post.new(id: 1, title: 'Post 1 Title', body: 'Post 1 Body')
452+
post1.comments = [Comment.new(id: 1, body: 'Comment on Post 1', post: post1)]
453+
post2 = Post.new(id: 2, title: 'Post 2 Title', body: 'Post 2 Body')
454+
post2.comments = [Comment.new(id: 2, body: 'Comment on Post 2', post: post2)]
455455
serialized_posts = {
456456
first: Set.new,
457-
second: Set.new,
457+
second: Set.new
458458
}
459-
t1 = Thread.new {
459+
t1 = Thread.new do
460460
10.times do
461461
serialized_posts[:first] << PostSerializer.new(post1, {}).to_json
462462
end
463-
}
464-
t2 = Thread.new {
463+
end
464+
t2 = Thread.new do
465465
10.times do
466466
serialized_posts[:second] << PostSerializer.new(post2, {}).to_json
467467
end
468-
}
468+
end
469469
t1.join
470470
t2.join
471-
expected_first_post_serialization = "{\"id\":1,\"title\":\"Post 1 Title\",\"body\":\"Post 1 Body\",\"comments\":[{\"id\":1,\"body\":\"Comment on Post 1\"}]}"
472-
expected_second_post_serialization = "{\"id\":2,\"title\":\"Post 2 Title\",\"body\":\"Post 2 Body\",\"comments\":[{\"id\":2,\"body\":\"Comment on Post 2\"}]}"
471+
expected_first_post_serialization = '{"id":1,"title":"Post 1 Title","body":"Post 1 Body","comments":[{"id":1,"body":"Comment on Post 1"}]}'
472+
expected_second_post_serialization = '{"id":2,"title":"Post 2 Title","body":"Post 2 Body","comments":[{"id":2,"body":"Comment on Post 2"}]}'
473473

474474
assert_equal [expected_second_post_serialization], serialized_posts[:second].to_a
475475
assert_equal [expected_first_post_serialization], serialized_posts[:first].to_a

0 commit comments

Comments
 (0)