1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-11-25 22:12:08 +02:00

Fix board request parameter

The BoardListOption field BoardType was incorrectly mapped to boardType
instead of type. This commit fixes it. A generic test helper
function (testRequestParams) is added in order to improve the
effectiveness of the unit test.

Fixes #213
This commit is contained in:
Dimitris Stafylarakis
2019-05-12 10:54:48 +02:00
committed by Andy Grunwald
parent 15b3b53643
commit 7e0dd0ed39
3 changed files with 18 additions and 1 deletions

View File

@@ -58,6 +58,22 @@ func testRequestURL(t *testing.T, r *http.Request, want string) {
}
}
func testRequestParams(t *testing.T, r *http.Request, want map[string]string) {
params := r.URL.Query()
if len(params) != len(want) {
t.Errorf("Request params: %d, want %d", len(params), len(want))
}
for key, val := range want {
if got := params.Get(key); val != got {
t.Errorf("Request params: %s, want %s", got, val)
}
}
}
func TestNewClient_WrongUrl(t *testing.T) {
c, err := NewClient(nil, "://issues.apache.org/jira/")