mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-03-25 21:28:55 +02:00
Merge remote-tracking branch 'origin/master' into develop
* origin/master: refactor project tests + go fmt add one more test for project service delete uncompleted boards # Conflicts: # board.go
This commit is contained in:
commit
ba0906a1b8
2
jira.go
2
jira.go
@ -3,10 +3,10 @@ package jira
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"fmt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// A Client manages communication with the JIRA API.
|
// A Client manages communication with the JIRA API.
|
||||||
|
@ -54,3 +54,27 @@ func TestProjectGet(t *testing.T) {
|
|||||||
t.Errorf("Error given: %s", err)
|
t.Errorf("Error given: %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestProjectGet_NoProject(t *testing.T) {
|
||||||
|
setup()
|
||||||
|
defer teardown()
|
||||||
|
testApiEdpoint := "/rest/api/2/project/99999999"
|
||||||
|
|
||||||
|
testMux.HandleFunc(testApiEdpoint, func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
testMethod(t, r, "GET")
|
||||||
|
testRequestURL(t, r, testApiEdpoint)
|
||||||
|
fmt.Fprint(w, nil)
|
||||||
|
})
|
||||||
|
|
||||||
|
projects, resp, err := testClient.Project.Get("99999999")
|
||||||
|
if projects != nil {
|
||||||
|
t.Errorf("Expected nil. Got %s", projects)
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.Status == "404" {
|
||||||
|
t.Errorf("Expected status 404. Got %s", resp.Status)
|
||||||
|
}
|
||||||
|
if err == nil {
|
||||||
|
t.Errorf("Error given: %s", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user