mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-08-06 22:13:02 +02:00
Wrap http.Response in Response struct
The Response struct has StartAt, MaxResults and Total fields, which are returned from JIRA API in issue search responses. They are now accessible in Response object.
This commit is contained in:
21
jira_test.go
21
jira_test.go
@ -296,3 +296,24 @@ func TestGetBaseURL_WithURL(t *testing.T) {
|
||||
t.Errorf("Base URLs are not equal. Expected %+v, got %+v", *u, b)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPagingInfoEmptyByDefault(t *testing.T) {
|
||||
c, _ := NewClient(nil, testJIRAInstanceURL)
|
||||
req, _ := c.NewRequest("GET", "/", nil)
|
||||
type foo struct {
|
||||
A string
|
||||
}
|
||||
body := new(foo)
|
||||
|
||||
resp, _ := c.Do(req, body)
|
||||
|
||||
if resp.StartAt != 0 {
|
||||
t.Errorf("StartAt not equal to 0")
|
||||
}
|
||||
if resp.MaxResults != 0 {
|
||||
t.Errorf("StartAt not equal to 0")
|
||||
}
|
||||
if resp.Total != 0 {
|
||||
t.Errorf("StartAt not equal to 0")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user