Rubocop: Consistent spacing

This commit is contained in:
Benjamin Fleischer
2015-08-31 04:22:59 -05:00
parent bdfe13c527
commit 228cc1c92a
47 changed files with 278 additions and 339 deletions

View File

@@ -48,7 +48,6 @@ module ActionController
def render_array_using_implicit_serializer_and_meta
with_adapter ActiveModel::Serializer::Adapter::JsonApi do
@profiles = [
Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' })
]
@@ -69,11 +68,11 @@ module ActionController
end
def render_json_object_without_serializer
render json: {error: 'Result is Invalid'}
render json: { error: 'Result is Invalid' }
end
def render_json_array_object_without_serializer
render json: [{error: 'Result is Invalid'}]
render json: [{ error: 'Result is Invalid' }]
end
def update_and_render_object_with_cache_enabled
@@ -138,6 +137,7 @@ module ActionController
end
private
def generate_cached_serializer(obj)
ActiveModel::SerializableResource.new(obj).to_json
end
@@ -188,7 +188,7 @@ module ActionController
def test_render_array_using_custom_root
get :render_array_using_custom_root
expected = {custom_roots: [{name: 'Name 1', description: 'Description 1'}]}
expected = { custom_roots: [{ name: 'Name 1', description: 'Description 1' }] }
assert_equal 'application/json', @response.content_type
assert_equal expected.to_json, @response.body
end
@@ -196,7 +196,7 @@ module ActionController
def test_render_array_that_is_empty_using_custom_root
get :render_array_that_is_empty_using_custom_root
expected = {custom_roots: []}
expected = { custom_roots: [] }
assert_equal 'application/json', @response.content_type
assert_equal expected.to_json, @response.body
end
@@ -204,7 +204,7 @@ module ActionController
def test_render_object_using_custom_root
get :render_object_using_custom_root
expected = {custom_root: {name: 'Name 1', description: 'Description 1'}}
expected = { custom_root: { name: 'Name 1', description: 'Description 1' } }
assert_equal 'application/json', @response.content_type
assert_equal expected.to_json, @response.body
end
@@ -213,7 +213,7 @@ module ActionController
get :render_json_object_without_serializer
assert_equal 'application/json', @response.content_type
expected_body = {error: 'Result is Invalid'}
expected_body = { error: 'Result is Invalid' }
assert_equal expected_body.to_json, @response.body
end
@@ -221,7 +221,7 @@ module ActionController
get :render_json_array_object_without_serializer
assert_equal 'application/json', @response.content_type
expected_body = [{error: 'Result is Invalid'}]
expected_body = [{ error: 'Result is Invalid' }]
assert_equal expected_body.to_json, @response.body
end
@@ -357,11 +357,11 @@ module ActionController
response = JSON.parse(@response.body)
expected_return = {
'id'=>1,
'time'=>Time.now.to_s,
'id' => 1,
'time' => Time.now.to_s,
'likeable' => {
'id'=>1,
'body'=>'ZOMG A COMMENT'
'id' => 1,
'body' => 'ZOMG A COMMENT'
}
}
@@ -384,7 +384,7 @@ module ActionController
body: 'ZOMG A COMMENT' }
],
blog: {
id:999,
id: 999,
name: 'Custom blog'
},
author: {