aboutsummaryrefslogtreecommitdiffstats
path: root/routers/user/home_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-03-31 15:47:00 +0800
committerGitHub <noreply@github.com>2020-03-31 10:47:00 +0300
commit73cf0e2614263c8c4ad6d55d06e753b28d2b6091 (patch)
treef29c9e8d5381aeeceb4acba1bde5bc9a3a45b29e /routers/user/home_test.go
parentbf847b9397b0365a81d1a2ca5386a6c4280d9e94 (diff)
downloadgitea-73cf0e2614263c8c4ad6d55d06e753b28d2b6091.tar.gz
gitea-73cf0e2614263c8c4ad6d55d06e753b28d2b6091.zip
Fix milestones too many SQL variables bug (#10880)
* Fix milestones too many SQL variables bug * Fix test * Don't display repositories with no milestone and fix tests * Remove unused code and add some comments
Diffstat (limited to 'routers/user/home_test.go')
-rw-r--r--routers/user/home_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/user/home_test.go b/routers/user/home_test.go
index 39186d93ee..ff48953d44 100644
--- a/routers/user/home_test.go
+++ b/routers/user/home_test.go
@@ -48,7 +48,7 @@ func TestMilestones(t *testing.T) {
assert.EqualValues(t, "furthestduedate", ctx.Data["SortType"])
assert.EqualValues(t, 1, ctx.Data["Total"])
assert.Len(t, ctx.Data["Milestones"], 1)
- assert.Len(t, ctx.Data["Repos"], 1)
+ assert.Len(t, ctx.Data["Repos"], 2) // both repo 42 and 1 have milestones and both are owned by user 2
}
func TestMilestonesForSpecificRepo(t *testing.T) {
@@ -68,5 +68,5 @@ func TestMilestonesForSpecificRepo(t *testing.T) {
assert.EqualValues(t, "furthestduedate", ctx.Data["SortType"])
assert.EqualValues(t, 1, ctx.Data["Total"])
assert.Len(t, ctx.Data["Milestones"], 1)
- assert.Len(t, ctx.Data["Repos"], 1)
+ assert.Len(t, ctx.Data["Repos"], 2) // both repo 42 and 1 have milestones and both are owned by user 2
}