@@ -371,6 +371,27 @@ func TestIssueReaction(t *testing.T) {
371371 session .MakeRequest (t , req , http .StatusOK )
372372}
373373
374+ func TestIssueListExport (t * testing.T ) {
375+ defer tests .PrepareTestEnv (t )()
376+ session := loginUser (t , "user2" )
377+ _ = testNewIssue (t , session , "user2" , "repo1" , "Title" , "Description" )
378+ _ = testNewIssue (t , session , "user2" , "repo1" , "Title2" , "Description2" )
379+ _ = testNewIssue (t , session , "user2" , "repo1" , "Title3" , "Description3" )
380+
381+ // trying to export all open issues of the given repository
382+ req := NewRequestWithValues (t , "GET" , fmt .Sprintf ("/%s/%s/issues/export?%s" , "user2" , "repo1" , "type=all&state=open" ))
383+ resp := session .MakeRequest (t , req , http .StatusOK )
384+
385+ // Content-Type should be an Excel file (XLSX)
386+ ct := strings .Split (resp .Header ().Get ("Content-Type" ), ";" )[0 ]
387+ assert .Equal (t , "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" , ct )
388+
389+ // Content-Disposition should indicate attachment with .xlsx
390+ cd := resp .Header ().Get ("Content-Disposition" )
391+ assert .Contains (t , cd , "attachment" )
392+ assert .True (t , strings .Contains (cd , ".xlsx" ))
393+ }
394+
374395func TestIssueCrossReference (t * testing.T ) {
375396 defer tests .PrepareTestEnv (t )()
376397
0 commit comments