@@ -345,6 +345,40 @@ func TestIssuesService_Edit(t *testing.T) {
345345 })
346346}
347347
348+ func TestIssuesService_RemoveMilestone (t * testing.T ) {
349+ client , mux , _ , teardown := setup ()
350+ defer teardown ()
351+ mux .HandleFunc ("/repos/o/r/issues/1" , func (w http.ResponseWriter , r * http.Request ) {
352+ testMethod (t , r , "PATCH" )
353+ fmt .Fprint (w , `{"number":1}` )
354+ })
355+
356+ ctx := context .Background ()
357+ issue , _ , err := client .Issues .RemoveMilestone (ctx , "o" , "r" , 1 )
358+ if err != nil {
359+ t .Errorf ("Issues.RemoveMilestone returned error: %v" , err )
360+ }
361+
362+ want := & Issue {Number : Int (1 )}
363+ if ! cmp .Equal (issue , want ) {
364+ t .Errorf ("Issues.RemoveMilestone returned %+v, want %+v" , issue , want )
365+ }
366+
367+ const methodName = "RemoveMilestone"
368+ testBadOptions (t , methodName , func () (err error ) {
369+ _ , _ , err = client .Issues .RemoveMilestone (ctx , "\n " , "\n " , - 1 )
370+ return err
371+ })
372+
373+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
374+ got , resp , err := client .Issues .RemoveMilestone (ctx , "o" , "r" , 1 )
375+ if got != nil {
376+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
377+ }
378+ return resp , err
379+ })
380+ }
381+
348382func TestIssuesService_Edit_invalidOwner (t * testing.T ) {
349383 client , _ , _ , teardown := setup ()
350384 defer teardown ()
0 commit comments