Skip to content

Commit 4ebe558

Browse files
author
chhsia0
committed
Matched title and desc in gitlab PR create test.
1 parent d886c16 commit 4ebe558

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

scm/driver/gitlab/pr_test.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,22 +153,24 @@ func TestPullClose(t *testing.T) {
153153
func TestPullCreate(t *testing.T) {
154154
defer gock.Off()
155155

156+
input := scm.PullRequestInput{
157+
Title: "JS fix",
158+
Body: "Signed-off-by: Dmitriy Zaporozhets <[email protected]>",
159+
Source: "fix",
160+
Target: "master",
161+
}
162+
156163
gock.New("https://gitlab.com").
157164
Post("/api/v4/projects/diaspora/diaspora/merge_requests").
158-
MatchParam("source_branch", "fix").
159-
MatchParam("target_branch", "master").
165+
MatchParam("title", input.Title).
166+
MatchParam("description", input.Body).
167+
MatchParam("source_branch", input.Source).
168+
MatchParam("target_branch", input.Target).
160169
Reply(201).
161170
Type("application/json").
162171
SetHeaders(mockHeaders).
163172
File("testdata/merge.json")
164173

165-
input := scm.PullRequestInput{
166-
Title: "JS fix",
167-
Body: `Signed-off-by: Dmitriy Zaporozhets \[email protected]\u003e`,
168-
Source: "fix",
169-
Target: "master",
170-
}
171-
172174
client := NewDefault()
173175
got, res, err := client.PullRequests.Create(context.Background(), "diaspora/diaspora", &input)
174176
if err != nil {

0 commit comments

Comments
 (0)