@@ -15,14 +15,9 @@ def test_render_inline_allocations
15
15
ViewComponent ::CompileCache . cache . delete ( MyComponent )
16
16
MyComponent . ensure_compiled
17
17
18
- allocations =
19
- if Rails . version . to_f < 8.0
20
- { "3.3.8" => 128 , "3.3.0" => 140 , "3.2.8" => 126 , "3.1.7" => 126 , "3.0.7" => 135 }
21
- elsif Rails . version . split ( "." ) . first ( 2 ) . map ( &:to_i ) == [ 8 , 0 ]
22
- { "3.5.0" => 121 , "3.4.3" => 125 , "3.3.8" => 137 }
23
- else
24
- { "3.4.3" => 123 }
25
- end
18
+ allocations = ( Rails . version . to_f >= 8.0 ) ?
19
+ { "3.5.0" => 123 , "3.4.2" => 125 , "3.3.7" => 138 } :
20
+ { "3.3.7" => 128 , "3.3.0" => 140 , "3.2.8" => 126 , "3.1.7" => 126 , "3.0.7" => 135 }
26
21
27
22
assert_allocations ( **allocations ) do
28
23
render_inline ( MyComponent . new )
@@ -1278,30 +1273,4 @@ def test_cache_component
1278
1273
assert_selector ( ".cache-component__cache-key" , text : new_component . view_cache_dependencies )
1279
1274
assert_selector ( ".cache-component__cache-message" , text : "foo baz" )
1280
1275
end
1281
-
1282
- def test_inherited_cache_component
1283
- component = InheritedCacheComponent . new ( foo : "foo" , bar : "bar" )
1284
- render_inline ( component )
1285
-
1286
- assert_selector ( ".cache-component__cache-key" , text : component . view_cache_dependencies )
1287
- assert_selector ( ".cache-component__cache-message" , text : "foo bar" )
1288
-
1289
- render_inline ( InheritedCacheComponent . new ( foo : "foo" , bar : "bar" ) )
1290
-
1291
- assert_selector ( ".cache-component__cache-key" , text : component . view_cache_dependencies )
1292
-
1293
- new_component = InheritedCacheComponent . new ( foo : "foo" , bar : "baz" )
1294
- render_inline ( new_component )
1295
-
1296
- assert_selector ( ".cache-component__cache-key" , text : new_component . view_cache_dependencies )
1297
- assert_selector ( ".cache-component__cache-message" , text : "foo baz" )
1298
- end
1299
-
1300
- def test_no_cache_component
1301
- component = NoCacheComponent . new ( foo : "foo" , bar : "bar" )
1302
- render_inline ( NoCacheComponent . new ( foo : "foo" , bar : "bar" ) )
1303
-
1304
- assert_selector ( ".cache-component__cache-key" , text : component . view_cache_dependencies )
1305
- assert_selector ( ".cache-component__cache-message" , text : "foo bar" )
1306
- end
1307
1276
end
0 commit comments