1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-03-21 21:07:03 +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:
Evgen Kostenko 2016-06-02 16:03:46 +03:00
commit ba0906a1b8
2 changed files with 25 additions and 1 deletions

View File

@ -3,10 +3,10 @@ package jira
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"fmt"
)
// A Client manages communication with the JIRA API.

View File

@ -54,3 +54,27 @@ func TestProjectGet(t *testing.T) {
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)
}
}