@@ -13,7 +13,7 @@ def render_using_implicit_serializer
13
13
14
14
def test_render_using_implicit_serializer
15
15
get :render_using_implicit_serializer
16
- assert_equal 'application/json' , @response . content_type
16
+ assert_includes @response . content_type , 'application/json'
17
17
assert_equal '{"profile":{"name":"Name 1","description":"Description 1"}}' , @response . body
18
18
end
19
19
end
@@ -35,7 +35,7 @@ def current_user
35
35
36
36
def test_render_using_implicit_serializer_and_scope
37
37
get :render_using_implicit_serializer_and_scope
38
- assert_equal 'application/json' , @response . content_type
38
+ assert_includes @response . content_type , 'application/json'
39
39
assert_equal '{"profile":{"name":"Name 1","description":"Description 1 - current_user"}}' , @response . body
40
40
end
41
41
end
@@ -65,7 +65,7 @@ def current_admin
65
65
66
66
def test_render_using_scope_set_in_default_serializer_options
67
67
get :render_using_scope_set_in_default_serializer_options
68
- assert_equal 'application/json' , @response . content_type
68
+ assert_includes @response . content_type , 'application/json'
69
69
assert_equal '{"profile":{"name":"Name 1","description":"Description 1 - current_admin"}}' , @response . body
70
70
end
71
71
end
@@ -91,7 +91,7 @@ def current_admin
91
91
92
92
def test_render_using_implicit_serializer_and_explicit_scope
93
93
get :render_using_implicit_serializer_and_explicit_scope
94
- assert_equal 'application/json' , @response . content_type
94
+ assert_includes @response . content_type , 'application/json'
95
95
assert_equal '{"profile":{"name":"Name 1","description":"Description 1 - current_admin"}}' , @response . body
96
96
end
97
97
end
@@ -117,7 +117,7 @@ def serialization_scope
117
117
118
118
def test_render_overriding_serialization_scope
119
119
get :render_overriding_serialization_scope
120
- assert_equal 'application/json' , @response . content_type
120
+ assert_includes @response . content_type , 'application/json'
121
121
assert_equal '{"profile":{"name":"Name 1","description":"Description 1 - current_admin"}}' , @response . body
122
122
end
123
123
end
@@ -141,7 +141,7 @@ def current_user
141
141
142
142
def test_render_calling_serialization_scope
143
143
get :render_calling_serialization_scope
144
- assert_equal 'application/json' , @response . content_type
144
+ assert_includes @response . content_type , 'application/json'
145
145
assert_equal '{"profile":{"name":"Name 1","description":"Description 1 - current_user"}}' , @response . body
146
146
end
147
147
end
@@ -157,7 +157,7 @@ def render_using_json_dump
157
157
158
158
def test_render_using_json_dump
159
159
get :render_using_json_dump
160
- assert_equal 'application/json' , @response . content_type
160
+ assert_includes @response . content_type , 'application/json'
161
161
assert_equal '{"hello":"world"}' , @response . body
162
162
end
163
163
end
@@ -173,7 +173,7 @@ def render_using_rails_behavior
173
173
174
174
def test_render_using_rails_behavior
175
175
get :render_using_rails_behavior
176
- assert_equal 'application/json' , @response . content_type
176
+ assert_includes @response . content_type , 'application/json'
177
177
assert_equal '[{"attributes":{"name":"Name 1","description":"Description 1","comments":"Comments 1"}}]' , @response . body
178
178
end
179
179
end
@@ -189,7 +189,7 @@ def render_array
189
189
190
190
def test_render_array
191
191
get :render_array
192
- assert_equal 'application/json' , @response . content_type
192
+ assert_includes @response . content_type , 'application/json'
193
193
assert_equal '{"my":[{"name":"Name 1","description":"Description 1"}]}' , @response . body
194
194
end
195
195
end
@@ -205,7 +205,7 @@ def render_array
205
205
206
206
def test_render_array
207
207
get :render_array
208
- assert_equal 'application/json' , @response . content_type
208
+ assert_includes @response . content_type , 'application/json'
209
209
assert_equal '{"webLog":[{"name":"Name 1","displayName":"Display Name 1"},{"name":"Name 2","displayName":"Display Name 2"}]}' , @response . body
210
210
end
211
211
end
@@ -223,7 +223,7 @@ def render_without_root
223
223
224
224
def test_render_without_root
225
225
get :render_without_root
226
- assert_equal 'application/json' , @response . content_type
226
+ assert_includes @response . content_type , 'application/json'
227
227
assert_equal '{"name":"Name 1","displayName":"Display Name 1"}' , @response . body
228
228
end
229
229
end
@@ -242,7 +242,7 @@ def render_array_without_root
242
242
243
243
def test_render_array_without_root
244
244
get :render_array_without_root
245
- assert_equal 'application/json' , @response . content_type
245
+ assert_includes @response . content_type , 'application/json'
246
246
assert_equal '[{"name":"Name 1","displayName":"Display Name 1"},{"name":"Name 2","displayName":"Display Name 2"}]' , @response . body
247
247
end
248
248
end
@@ -278,7 +278,7 @@ def test_render_array_embeding_in_root
278
278
@association . embed_in_root = true
279
279
280
280
get :render_array_embeding_in_root
281
- assert_equal 'application/json' , @response . content_type
281
+ assert_includes @response . content_type , 'application/json'
282
282
283
283
assert_equal ( "{\" my\" :[{\" name\" :\" Name 1\" ,\" email\" :\" [email protected] \" ,\" profile_id\" :#{ @controller . user . profile . object_id } }],\" profiles\" :[{\" name\" :\" N1\" ,\" description\" :\" D1\" }]}" , @response . body )
284
284
end
0 commit comments