1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-04-13 11:40:36 +02:00

Moves error handle up so we see the error, instead of just seeing that the value didnt get populated

This commit is contained in:
spmassot 2018-10-17 16:25:06 -04:00
parent b8740711f0
commit f87c8b0ab5
2 changed files with 7 additions and 8 deletions

View File

@ -31,9 +31,9 @@ type IssueService struct {
// UpdateQueryOptions specifies the optional parameters to the Edit issue
type UpdateQueryOptions struct {
NotifyUsers string `url:"notifyUsers,omitempty"`
OverrideScreenSecurity string `url:"overrideScreenSecurity,omitempty"`
OverrideEditableFlag string `url:"overrideEditableFlag,omitempty"`
NotifyUsers bool `url:"notifyUsers,omitempty"`
OverrideScreenSecurity bool `url:"overrideScreenSecurity,omitempty"`
OverrideEditableFlag bool `url:"overrideEditableFlag,omitempty"`
}
// Issue represents a JIRA issue.

View File

@ -96,12 +96,12 @@ func TestIssueService_Update(t *testing.T) {
},
}
issue, _, err := testClient.Issue.Update(i)
if issue == nil {
t.Error("Expected issue. Issue is nil")
}
if err != nil {
t.Errorf("Error given: %s", err)
}
if issue == nil {
t.Error("Expected issue. Issue is nil")
}
}
func TestIssueService_UpdateIssue(t *testing.T) {
@ -1349,7 +1349,6 @@ func TestIssueService_UpdateAssignee(t *testing.T) {
}
}
func TestIssueService_Get_Fields_Changelog(t *testing.T) {
setup()
defer teardown()
@ -1360,7 +1359,7 @@ func TestIssueService_Get_Fields_Changelog(t *testing.T) {
fmt.Fprint(w, `{"expand":"changelog","id":"10002","self":"http://www.example.com/jira/rest/api/2/issue/10002","key":"EX-1","changelog":{"startAt": 0,"maxResults": 1, "total": 1, "histories": [{"id": "10002", "author": {"self": "http://www.example.com/jira/rest/api/2/user?username=fred", "name": "fred", "key": "fred", "emailAddress": "fred@example.com", "avatarUrls": {"48x48": "http://www.example.com/secure/useravatar?ownerId=fred&avatarId=33072", "24x24": "http://www.example.com/secure/useravatar?size=small&ownerId=fred&avatarId=33072", "16x16": "http://www.example.com/secure/useravatar?size=xsmall&ownerId=fred&avatarId=33072", "32x32": "http://www.example.com/secure/useravatar?size=medium&ownerId=fred&avatarId=33072"},"displayName":"Fred","active": true,"timeZone":"Australia/Sydney"},"created":"2018-06-20T16:50:35.000+0300","items":[{"field":"Rank","fieldtype":"custom","from":"","fromString":"","to":"","toString":"Ranked higher"}]}]}}`)
})
issue, _, _ := testClient.Issue.Get("10002", &GetQueryOptions{Expand:"changelog"})
issue, _, _ := testClient.Issue.Get("10002", &GetQueryOptions{Expand: "changelog"})
if issue == nil {
t.Error("Expected issue. Issue is nil")
}