Skip to content

Commit

Permalink
Merge pull request #12 from ngs/fix-response
Browse files Browse the repository at this point in the history
Fix response
  • Loading branch information
ngs committed Feb 19, 2018
2 parents ca124b5 + e91ed75 commit f8889cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/slack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func testGetActionCallbackWithActionType(t *testing.T, actionType string, succes
test.Compare(t)
}

setupActionCallbackGocks(actionType, "OK")
setupActionCallbackGocks(actionType, `"OK"`)
msg, responseURL, err = ctx.getActionCallback(&slack.AttachmentActionCallback{
Actions: []slack.AttachmentAction{{Name: actionType}},
Token: app.SlackVerificationToken,
Expand Down
5 changes: 3 additions & 2 deletions app/timetable.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,11 @@ func (client *timeTableClient) UpdateTimeTable(timeTable *timeTable) (bool, erro
return false, err
}
body, err := client.doRequest(http.MethodPost, bytes.NewBuffer(b))
fmt.Printf("%v %v %v\n", string(body), err, string(body) == `"OK"`)
if err != nil {
return false, err
}
return string(body) == "OK", nil
return string(body) == `"OK"`, nil
}

func (client *timeTableClient) SetAttendance(attendance bool) (bool, error) {
Expand All @@ -198,5 +199,5 @@ func (client *timeTableClient) SetAttendance(attendance bool) (bool, error) {
if err != nil {
return false, err
}
return string(body) == "OK", nil
return string(body) == `"OK"`, nil
}

0 comments on commit f8889cd

Please sign in to comment.