Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
68c08691
Unverified
Commit
68c08691
authored
Feb 24, 2019
by
Sander van Harmelen
Committed by
GitHub
Feb 24, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #570 from ZJvandeWeg/zj-fix-todo-approvals-before-merge
Fix type for ApprovalsBeforeMerge
parents
8e525d78
0ad0be28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
todos.go
todos.go
+1
-1
todos_test.go
todos_test.go
+2
-2
No files found.
todos.go
View file @
68c08691
...
@@ -67,7 +67,7 @@ type TodoTarget struct {
...
@@ -67,7 +67,7 @@ type TodoTarget struct {
Weight
int
`json:"weight"`
Weight
int
`json:"weight"`
// Only available for type MergeRequest
// Only available for type MergeRequest
ApprovalsBeforeMerge
bool
`json:"approvals_before_merge"`
ApprovalsBeforeMerge
int
`json:"approvals_before_merge"`
ForceRemoveSourceBranch
bool
`json:"force_remove_source_branch"`
ForceRemoveSourceBranch
bool
`json:"force_remove_source_branch"`
MergeCommitSHA
string
`json:"merge_commit_sha"`
MergeCommitSHA
string
`json:"merge_commit_sha"`
MergeWhenPipelineSucceeds
bool
`json:"merge_when_pipeline_succeeds"`
MergeWhenPipelineSucceeds
bool
`json:"merge_when_pipeline_succeeds"`
...
...
todos_test.go
View file @
68c08691
...
@@ -13,7 +13,7 @@ func TestListTodos(t *testing.T) {
...
@@ -13,7 +13,7 @@ func TestListTodos(t *testing.T) {
mux
.
HandleFunc
(
"/api/v4/todos"
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
mux
.
HandleFunc
(
"/api/v4/todos"
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
testMethod
(
t
,
r
,
"GET"
)
testMethod
(
t
,
r
,
"GET"
)
fmt
.
Fprint
(
w
,
`[{"id":1,"state": "pending"
},{"id":2,"state":"pending"
}]`
)
fmt
.
Fprint
(
w
,
`[{"id":1,"state": "pending"
,"target":{"id":1,"approvals_before_merge":2}},{"id":2,"state":"pending","target":{"id":2,"approvals_before_merge":null}
}]`
)
})
})
opts
:=
&
ListTodosOptions
{}
opts
:=
&
ListTodosOptions
{}
...
@@ -23,7 +23,7 @@ func TestListTodos(t *testing.T) {
...
@@ -23,7 +23,7 @@ func TestListTodos(t *testing.T) {
t
.
Errorf
(
"Todos.ListTodos returned error: %v"
,
err
)
t
.
Errorf
(
"Todos.ListTodos returned error: %v"
,
err
)
}
}
want
:=
[]
*
Todo
{{
ID
:
1
,
State
:
"pending"
},
{
ID
:
2
,
State
:
"pending"
}}
want
:=
[]
*
Todo
{{
ID
:
1
,
State
:
"pending"
,
Target
:
TodoTarget
{
ID
:
1
,
ApprovalsBeforeMerge
:
2
}},
{
ID
:
2
,
State
:
"pending"
,
Target
:
TodoTarget
{
ID
:
2
}
}}
if
!
reflect
.
DeepEqual
(
want
,
todos
)
{
if
!
reflect
.
DeepEqual
(
want
,
todos
)
{
t
.
Errorf
(
"Todos.ListTodos returned %+v, want %+v"
,
todos
,
want
)
t
.
Errorf
(
"Todos.ListTodos returned %+v, want %+v"
,
todos
,
want
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment