@@ -410,3 +410,36 @@ unittest
410410
411411 postGitHubHook(" dlang_phobos_synchronize_4921.json" );
412412}
413+
414+ // Remove old labels on push
415+ unittest
416+ {
417+ import std.array : replace;
418+ foreach (label; [" needs work" , " Needs work" , " stalled" ])
419+ {
420+ setAPIExpectations(
421+ " /github/repos/dlang/phobos/pulls/4921/commits" , (ref Json j) {
422+ j = Json.emptyArray;
423+ },
424+ " /github/repos/dlang/phobos/issues/4921/labels" , (ref Json j) {
425+ j[0 ][" name" ] = label;
426+ },
427+ // encodeComponent is avoided on purpose
428+ " /github/repos/dlang/phobos/issues/4921/labels/" ~ label.replace(" " , " %20" ),
429+ (scope HTTPServerRequest req, scope HTTPServerResponse res){
430+ assert (req.method == HTTPMethod.DELETE );
431+ },
432+ " /github/repos/dlang/phobos/issues/4921/comments" ,
433+ " /github/orgs/dlang/public_members?per_page=100" ,
434+ " /github/repos/dlang/phobos/issues/comments/262784442" ,
435+ (scope HTTPServerRequest req, scope HTTPServerResponse res){
436+ assert (req.method == HTTPMethod.PATCH );
437+ auto body_ = req.json[" body" ].get ! string ;
438+ assert (body_.canFind(" @andralex" ));
439+ assert (! body_.canFind(" Auto-close | Bugzilla" ), " Shouldn't contain bug header" );
440+ assert (! body_.canFind(" /show_bug.cgi?id=" ), " Shouldn't contain a Bugzilla reference" );
441+ }
442+ );
443+ postGitHubHook(" dlang_phobos_synchronize_4921.json" );
444+ }
445+ }
0 commit comments