@@ -26,6 +26,7 @@ import (
2626 "math/rand"
2727 "net/http"
2828 "os"
29+ "reflect"
2930 "strings"
3031 "sync"
3132 "testing"
@@ -548,7 +549,7 @@ var _ = Describe("GitLab Provider", func() {
548549 Permission : & pushPermission ,
549550 }
550551
551- ta , actionTaken , err = repo .TeamAccess ().Reconcile (ctx , teamInfo )
552+ _ , actionTaken , err = repo .TeamAccess ().Reconcile (ctx , teamInfo )
552553 Expect (err ).ToNot (HaveOccurred ())
553554 Expect (actionTaken ).To (Equal (false ))
554555 })
@@ -752,7 +753,7 @@ var _ = Describe("GitLab Provider", func() {
752753 validateUserRepo (newRepo , repoRef )
753754 })
754755
755- It ("should be possible to create a pr for a user repository" , func () {
756+ It ("should be possible to create and edit a pr for a user repository" , func () {
756757
757758 testRepoName = fmt .Sprintf ("test-repo2-%03d" , rand .Intn (1000 ))
758759 repoRef := newUserRepoRef (testUserName , testRepoName )
@@ -865,8 +866,20 @@ var _ = Describe("GitLab Provider", func() {
865866 Expect (pr .Get ().WebURL ).ToNot (BeEmpty ())
866867 Expect (pr .Get ().Merged ).To (BeFalse ())
867868
868- err = userRepo .PullRequests ().Merge (ctx , pr .Get ().Number , gitprovider .MergeMethodMerge , "merged" )
869+ editedPR , err := userRepo .PullRequests ().Edit (ctx , pr .Get ().Number , gitprovider.EditOptions {
870+ Title : gitprovider .StringVar ("a new title" ),
871+ })
872+ Expect (err ).ToNot (HaveOccurred ())
873+
874+ err = userRepo .PullRequests ().Merge (ctx , editedPR .Get ().Number , gitprovider .MergeMethodMerge , "merged" )
875+ Expect (err ).ToNot (HaveOccurred ())
876+
877+ getPR , err := userRepo .PullRequests ().Get (ctx , editedPR .Get ().Number )
869878 Expect (err ).ToNot (HaveOccurred ())
879+ apiObject := getPR .APIObject ()
880+ gitlabMR , ok := apiObject .(* gitlab.MergeRequest )
881+ Expect (ok ).To (BeTrue (), "API object of PullRequest has unexpected type %q" , reflect .TypeOf (apiObject ))
882+ Expect (gitlabMR .Title ).To (Equal ("a new title" ))
870883
871884 expectPRToBeMerged (ctx , userRepo , pr .Get ().Number )
872885
0 commit comments