summaryrefslogtreecommitdiffstats
path: root/models/star_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/star_test.go')
-rw-r--r--models/star_test.go21
1 files changed, 17 insertions, 4 deletions
diff --git a/models/star_test.go b/models/star_test.go
index 7b7fd516e3..d6a83199b7 100644
--- a/models/star_test.go
+++ b/models/star_test.go
@@ -53,12 +53,12 @@ func TestUser_GetStarredRepos(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
user := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
- starred, err := user.GetStarredRepos(false)
+ starred, err := user.GetStarredRepos(false, 1, 10, "")
assert.NoError(t, err)
assert.Len(t, starred, 1)
assert.Equal(t, int64(4), starred[0].ID)
- starred, err = user.GetStarredRepos(true)
+ starred, err = user.GetStarredRepos(true, 1, 10, "")
assert.NoError(t, err)
assert.Len(t, starred, 2)
assert.Equal(t, int64(4), starred[0].ID)
@@ -70,11 +70,24 @@ func TestUser_GetStarredRepos2(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
user := AssertExistsAndLoadBean(t, &User{ID: 1}).(*User)
- starred, err := user.GetStarredRepos(false)
+ starred, err := user.GetStarredRepos(false, 1, 10, "")
assert.NoError(t, err)
assert.Len(t, starred, 0)
- starred, err = user.GetStarredRepos(true)
+ starred, err = user.GetStarredRepos(true, 1, 10, "")
assert.NoError(t, err)
assert.Len(t, starred, 0)
}
+
+func TestUserGetStarredRepoCount(t *testing.T) {
+ assert.NoError(t, PrepareTestDatabase())
+
+ user := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
+ counts, err := user.GetStarredRepoCount(false)
+ assert.NoError(t, err)
+ assert.Equal(t, int64(1), counts)
+
+ counts, err = user.GetStarredRepoCount(true)
+ assert.NoError(t, err)
+ assert.Equal(t, int64(2), counts)
+}