Skip to content

Commit

Permalink
Add Integrations Test
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Nov 29, 2019
1 parent 0e406a7 commit 1171bac
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions integrations/issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,32 @@ func TestIssueCommentClose(t *testing.T) {
assert.Equal(t, "Description", val)
}

func TestIssueReaction(t *testing.T) {
defer prepareTestEnv(t)()
session := loginUser(t, "user2")
issueURL := testNewIssue(t, session, "user2", "repo1", "Title", "Description")

req := NewRequest(t, "GET", issueURL)
resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)

req = NewRequestWithValues(t, "POST", path.Join(issueURL, "/reactions/react"), map[string]string{
"_csrf": htmlDoc.GetCSRF(),
"content": "8ball",
})
session.MakeRequest(t, req, http.StatusInternalServerError)
req = NewRequestWithValues(t, "POST", path.Join(issueURL, "/reactions/react"), map[string]string{
"_csrf": htmlDoc.GetCSRF(),
"content": "eyes",
})
session.MakeRequest(t, req, http.StatusOK)
req = NewRequestWithValues(t, "POST", path.Join(issueURL, "/reactions/unreact"), map[string]string{
"_csrf": htmlDoc.GetCSRF(),
"content": "eyes",
})
session.MakeRequest(t, req, http.StatusOK)
}

func TestIssueCrossReference(t *testing.T) {
defer prepareTestEnv(t)()

Expand Down

0 comments on commit 1171bac

Please sign in to comment.