@@ -1218,7 +1218,11 @@ def assert_restful_routes_for(controller_name, options = {})
1218
1218
assert_recognizes ( options [ :shallow_options ] . merge ( action : "update" , id : "1" , format : "xml" ) , path : "#{ member_path } .xml" , method : :put )
1219
1219
assert_recognizes ( options [ :shallow_options ] . merge ( action : "destroy" , id : "1" , format : "xml" ) , path : "#{ member_path } .xml" , method : :delete )
1220
1220
1221
- yield route_options if block_given?
1221
+ if block_given?
1222
+ _assert_nothing_raised_or_warn ( "assert_restful_routes_for" ) do
1223
+ yield route_options
1224
+ end
1225
+ end
1222
1226
end
1223
1227
1224
1228
# test named routes like foo_path and foos_path map to the correct options.
@@ -1267,7 +1271,11 @@ def assert_restful_named_routes_for(controller_name, singular_name = nil, option
1267
1271
assert_named_route "#{ shallow_path } /1/#{ edit_action } " , "edit_#{ shallow_prefix } #{ singular_name } _path" , options [ :shallow_options ] . merge ( id : "1" )
1268
1272
assert_named_route "#{ shallow_path } /1/#{ edit_action } .xml" , "edit_#{ shallow_prefix } #{ singular_name } _path" , options [ :shallow_options ] . merge ( id : "1" , format : "xml" )
1269
1273
1270
- yield route_options if block_given?
1274
+ if block_given?
1275
+ _assert_nothing_raised_or_warn ( "assert_restful_named_routes_for" ) do
1276
+ yield route_options
1277
+ end
1278
+ end
1271
1279
end
1272
1280
1273
1281
def assert_singleton_routes_for ( singleton_name , options = { } )
@@ -1302,7 +1310,11 @@ def assert_singleton_routes_for(singleton_name, options = {})
1302
1310
assert_recognizes ( route_options . merge ( action : "update" , format : "xml" ) , path : "#{ full_path } .xml" , method : :put )
1303
1311
assert_recognizes ( route_options . merge ( action : "destroy" , format : "xml" ) , path : "#{ full_path } .xml" , method : :delete )
1304
1312
1305
- yield route_options if block_given?
1313
+ if block_given?
1314
+ _assert_nothing_raised_or_warn ( "assert_singleton_routes_for" ) do
1315
+ yield route_options
1316
+ end
1317
+ end
1306
1318
end
1307
1319
1308
1320
def assert_singleton_named_routes_for ( singleton_name , options = { } )
@@ -1323,6 +1335,12 @@ def assert_singleton_named_routes_for(singleton_name, options = {})
1323
1335
assert_named_route "#{ full_path } /new.xml" , "new_#{ name_prefix } #{ singleton_name } _path" , route_options . merge ( format : "xml" )
1324
1336
assert_named_route "#{ full_path } /edit" , "edit_#{ name_prefix } #{ singleton_name } _path" , route_options
1325
1337
assert_named_route "#{ full_path } /edit.xml" , "edit_#{ name_prefix } #{ singleton_name } _path" , route_options . merge ( format : "xml" )
1338
+
1339
+ if block_given?
1340
+ _assert_nothing_raised_or_warn ( "assert_singleton_named_routes_for" ) do
1341
+ yield route_options
1342
+ end
1343
+ end
1326
1344
end
1327
1345
1328
1346
def assert_named_route ( expected , route , options )
0 commit comments