@@ -194,6 +194,32 @@ func TestIssueCommentClose(t *testing.T) {
194
194
assert .Equal (t , "Description" , val )
195
195
}
196
196
197
+ func TestIssueReaction (t * testing.T ) {
198
+ defer prepareTestEnv (t )()
199
+ session := loginUser (t , "user2" )
200
+ issueURL := testNewIssue (t , session , "user2" , "repo1" , "Title" , "Description" )
201
+
202
+ req := NewRequest (t , "GET" , issueURL )
203
+ resp := session .MakeRequest (t , req , http .StatusOK )
204
+ htmlDoc := NewHTMLParser (t , resp .Body )
205
+
206
+ req = NewRequestWithValues (t , "POST" , path .Join (issueURL , "/reactions/react" ), map [string ]string {
207
+ "_csrf" : htmlDoc .GetCSRF (),
208
+ "content" : "8ball" ,
209
+ })
210
+ session .MakeRequest (t , req , http .StatusInternalServerError )
211
+ req = NewRequestWithValues (t , "POST" , path .Join (issueURL , "/reactions/react" ), map [string ]string {
212
+ "_csrf" : htmlDoc .GetCSRF (),
213
+ "content" : "eyes" ,
214
+ })
215
+ session .MakeRequest (t , req , http .StatusOK )
216
+ req = NewRequestWithValues (t , "POST" , path .Join (issueURL , "/reactions/unreact" ), map [string ]string {
217
+ "_csrf" : htmlDoc .GetCSRF (),
218
+ "content" : "eyes" ,
219
+ })
220
+ session .MakeRequest (t , req , http .StatusOK )
221
+ }
222
+
197
223
func TestIssueCrossReference (t * testing.T ) {
198
224
defer prepareTestEnv (t )()
199
225
0 commit comments