File tree Expand file tree Collapse file tree 2 files changed +3
-13
lines changed
test/action_controller/json_api Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Original file line number Diff line number Diff line change 9
9
10
10
11
11
12
- # Offense count: 3
13
- # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
14
- # NamePrefix: is_, has_, have_
15
- # NamePrefixBlacklist: is_, has_, have_
16
- # NameWhitelist: is_a?
17
- Style/PredicateName :
18
- Exclude :
19
- - ' lib/active_model/serializer/associations.rb'
20
- - ' test/action_controller/json_api/linked_test.rb'
21
-
22
12
Original file line number Diff line number Diff line change @@ -183,17 +183,17 @@ def test_render_resource_with_nested_attributes_even_when_missing_associations
183
183
get '/render_resource_with_missing_nested_has_many_include'
184
184
response = JSON . parse ( @response . body )
185
185
assert response . key? 'included'
186
- refute has_type ?( response [ 'included' ] , 'roles' )
186
+ refute include_type ?( response [ 'included' ] , 'roles' )
187
187
end
188
188
189
189
def test_render_collection_with_missing_nested_has_many_include
190
190
get '/render_collection_with_missing_nested_has_many_include'
191
191
response = JSON . parse ( @response . body )
192
192
assert response . key? 'included'
193
- assert has_type ?( response [ 'included' ] , 'roles' )
193
+ assert include_type ?( response [ 'included' ] , 'roles' )
194
194
end
195
195
196
- def has_type ?( collection , value )
196
+ def include_type ?( collection , value )
197
197
collection . detect { |i | i [ 'type' ] == value }
198
198
end
199
199
end
You can’t perform that action at this time.
0 commit comments