Skip to content

Commit 004f143

Browse files
committed
re: RuboCop - hash indention corrections
1 parent f15f685 commit 004f143

File tree

8 files changed

+244
-244
lines changed

8 files changed

+244
-244
lines changed

test/adapter/json/transform_test.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class PostSerializer < ActiveModel::Serializer
2828
def test_transform_default
2929
mock_request
3030
assert_equal({
31-
blog: { id: 1, special_attribute: 'neat', articles: nil }
32-
}, @adapter.serializable_hash)
31+
blog: { id: 1, special_attribute: 'neat', articles: nil }
32+
}, @adapter.serializable_hash)
3333
end
3434

3535
def test_transform_global_config
@@ -38,8 +38,8 @@ def test_transform_global_config
3838
@adapter.serializable_hash
3939
end
4040
assert_equal({
41-
blog: { id: 1, specialAttribute: 'neat', articles: nil }
42-
}, result)
41+
blog: { id: 1, specialAttribute: 'neat', articles: nil }
42+
}, result)
4343
end
4444

4545
def test_transform_serialization_ctx_overrides_global_config
@@ -48,8 +48,8 @@ def test_transform_serialization_ctx_overrides_global_config
4848
@adapter.serializable_hash
4949
end
5050
assert_equal({
51-
Blog: { Id: 1, SpecialAttribute: 'neat', Articles: nil }
52-
}, result)
51+
Blog: { Id: 1, SpecialAttribute: 'neat', Articles: nil }
52+
}, result)
5353
end
5454

5555
def test_transform_undefined
@@ -63,29 +63,29 @@ def test_transform_undefined
6363
def test_transform_dash
6464
mock_request(:dash)
6565
assert_equal({
66-
blog: { id: 1, :"special-attribute" => 'neat', articles: nil }
67-
}, @adapter.serializable_hash)
66+
blog: { id: 1, :"special-attribute" => 'neat', articles: nil }
67+
}, @adapter.serializable_hash)
6868
end
6969

7070
def test_transform_unaltered
7171
mock_request(:unaltered)
7272
assert_equal({
73-
blog: { id: 1, special_attribute: 'neat', articles: nil }
74-
}, @adapter.serializable_hash)
73+
blog: { id: 1, special_attribute: 'neat', articles: nil }
74+
}, @adapter.serializable_hash)
7575
end
7676

7777
def test_transform_camel
7878
mock_request(:camel)
7979
assert_equal({
80-
Blog: { Id: 1, SpecialAttribute: 'neat', Articles: nil }
81-
}, @adapter.serializable_hash)
80+
Blog: { Id: 1, SpecialAttribute: 'neat', Articles: nil }
81+
}, @adapter.serializable_hash)
8282
end
8383

8484
def test_transform_camel_lower
8585
mock_request(:camel_lower)
8686
assert_equal({
87-
blog: { id: 1, specialAttribute: 'neat', articles: nil }
88-
}, @adapter.serializable_hash)
87+
blog: { id: 1, specialAttribute: 'neat', articles: nil }
88+
}, @adapter.serializable_hash)
8989
end
9090
end
9191
end

test/adapter/json_api/errors_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ def setup
1212

1313
def test_active_model_with_error
1414
options = {
15-
serializer: ActiveModel::Serializer::ErrorSerializer,
16-
adapter: :json_api
15+
serializer: ActiveModel::Serializer::ErrorSerializer,
16+
adapter: :json_api
1717
}
1818

1919
@resource.errors.add(:name, 'cannot be nil')
@@ -35,8 +35,8 @@ def test_active_model_with_error
3535

3636
def test_active_model_with_multiple_errors
3737
options = {
38-
serializer: ActiveModel::Serializer::ErrorSerializer,
39-
adapter: :json_api
38+
serializer: ActiveModel::Serializer::ErrorSerializer,
39+
adapter: :json_api
4040
}
4141

4242
@resource.errors.add(:name, 'cannot be nil')

test/adapter/json_api/has_many_test.rb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -112,31 +112,31 @@ def test_has_many_with_no_serializer
112112
adapter = ActiveModelSerializers::Adapter::JsonApi.new(serializer)
113113

114114
assert_equal({
115-
data: {
116-
id: '1',
117-
type: 'posts',
118-
relationships: {
119-
tags: { data: [@tag.as_json] }
120-
}
121-
}
122-
}, adapter.serializable_hash)
115+
data: {
116+
id: '1',
117+
type: 'posts',
118+
relationships: {
119+
tags: { data: [@tag.as_json] }
120+
}
121+
}
122+
}, adapter.serializable_hash)
123123
end
124124

125125
def test_has_many_with_virtual_value
126126
serializer = VirtualValueSerializer.new(@virtual_value)
127127
adapter = ActiveModelSerializers::Adapter::JsonApi.new(serializer)
128128

129129
assert_equal({
130-
data: {
131-
id: '1',
132-
type: 'virtual-values',
133-
relationships: {
134-
maker: { data: { type: 'makers', id: '1' } },
135-
reviews: { data: [{ type: 'reviews', id: '1' },
136-
{ type: 'reviews', id: '2' }] }
137-
}
138-
}
139-
}, adapter.serializable_hash)
130+
data: {
131+
id: '1',
132+
type: 'virtual-values',
133+
relationships: {
134+
maker: { data: { type: 'makers', id: '1' } },
135+
reviews: { data: [{ type: 'reviews', id: '1' },
136+
{ type: 'reviews', id: '2' }] }
137+
}
138+
}
139+
}, adapter.serializable_hash)
140140
end
141141
end
142142
end

test/adapter/json_api/json_api_test.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ def test_custom_keys
2222
adapter = ActiveModelSerializers::Adapter::JsonApi.new(serializer)
2323

2424
assert_equal({
25-
reviews: { data: [{ type: 'comments', id: '1' },
26-
{ type: 'comments', id: '2' }] },
27-
writer: { data: { type: 'authors', id: '1' } },
28-
site: { data: { type: 'blogs', id: '1' } }
29-
}, adapter.serializable_hash[:data][:relationships])
25+
reviews: { data: [{ type: 'comments', id: '1' },
26+
{ type: 'comments', id: '2' }] },
27+
writer: { data: { type: 'authors', id: '1' } },
28+
site: { data: { type: 'blogs', id: '1' } }
29+
}, adapter.serializable_hash[:data][:relationships])
3030
end
3131
end
3232
end

0 commit comments

Comments
 (0)