aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/pull_review_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/pull_review_test.go')
-rw-r--r--routers/web/repo/pull_review_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/routers/web/repo/pull_review_test.go b/routers/web/repo/pull_review_test.go
index 5f035f1eb0..8344ff4091 100644
--- a/routers/web/repo/pull_review_test.go
+++ b/routers/web/repo/pull_review_test.go
@@ -4,6 +4,7 @@
package repo
import (
+ "net/http"
"net/http/httptest"
"testing"
@@ -73,4 +74,20 @@ func TestRenderConversation(t *testing.T) {
renderConversation(ctx, preparedComment, "timeline")
assert.Contains(t, resp.Body.String(), `<div id="code-comments-`)
})
+ run("diff non-existing review", func(t *testing.T, ctx *context.Context, resp *httptest.ResponseRecorder) {
+ err := db.TruncateBeans(db.DefaultContext, &issues_model.Review{})
+ assert.NoError(t, err)
+ ctx.Data["ShowOutdatedComments"] = true
+ renderConversation(ctx, preparedComment, "diff")
+ assert.Equal(t, http.StatusOK, resp.Code)
+ assert.NotContains(t, resp.Body.String(), `status-page-500`)
+ })
+ run("timeline non-existing review", func(t *testing.T, ctx *context.Context, resp *httptest.ResponseRecorder) {
+ err := db.TruncateBeans(db.DefaultContext, &issues_model.Review{})
+ assert.NoError(t, err)
+ ctx.Data["ShowOutdatedComments"] = true
+ renderConversation(ctx, preparedComment, "timeline")
+ assert.Equal(t, http.StatusOK, resp.Code)
+ assert.NotContains(t, resp.Body.String(), `status-page-500`)
+ })
}