diff options
author | Morlinest <morlinest@gmail.com> | 2017-10-10 22:37:18 +0200 |
---|---|---|
committer | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2017-10-10 22:37:18 +0200 |
commit | dff26e25ca4e088ac709bc4b11eb84cdb9603d34 (patch) | |
tree | 2718eafc36bf69f4915ddf1aa83fe1fcf112d4f5 /models/repo_list_test.go | |
parent | c2346e44696e57c31f9765c32ee60b365a15c8f0 (diff) | |
download | gitea-dff26e25ca4e088ac709bc4b11eb84cdb9603d34.tar.gz gitea-dff26e25ca4e088ac709bc4b11eb84cdb9603d34.zip |
Remove redudant functions and code (#2652)
* Remove redudant functions and code
Diffstat (limited to 'models/repo_list_test.go')
-rw-r--r-- | models/repo_list_test.go | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/models/repo_list_test.go b/models/repo_list_test.go index 6f829f279d..160ba57d32 100644 --- a/models/repo_list_test.go +++ b/models/repo_list_test.go @@ -98,6 +98,24 @@ func TestSearchRepositoryByName(t *testing.T) { {name: "PublicAndPrivateRepositoriesOfOrganization", opts: &SearchRepoOptions{Page: 1, PageSize: 10, OwnerID: 17, Private: true}, count: 2}, + {name: "AllPublic/PublicRepositoriesByName", + opts: &SearchRepoOptions{Keyword: "big_test_", PageSize: 10, AllPublic: true}, + count: 4}, + {name: "AllPublic/PublicAndPrivateRepositoriesByName", + opts: &SearchRepoOptions{Keyword: "big_test_", Page: 1, PageSize: 10, Private: true, AllPublic: true}, + count: 8}, + {name: "AllPublic/PublicRepositoriesOfUserIncludingCollaborative", + opts: &SearchRepoOptions{Page: 1, PageSize: 10, OwnerID: 15, Collaborate: true, AllPublic: true}, + count: 12}, + {name: "AllPublic/PublicAndPrivateRepositoriesOfUserIncludingCollaborative", + opts: &SearchRepoOptions{Page: 1, PageSize: 10, OwnerID: 15, Private: true, Collaborate: true, AllPublic: true}, + count: 16}, + {name: "AllPublic/PublicAndPrivateRepositoriesOfUserIncludingCollaborativeByName", + opts: &SearchRepoOptions{Keyword: "test", Page: 1, PageSize: 10, OwnerID: 15, Private: true, Collaborate: true, AllPublic: true}, + count: 10}, + {name: "AllPublic/PublicRepositoriesOfOrganization", + opts: &SearchRepoOptions{Page: 1, PageSize: 10, OwnerID: 17, AllPublic: true}, + count: 12}, } for _, testCase := range testCases { @@ -126,7 +144,7 @@ func TestSearchRepositoryByName(t *testing.T) { } // FIXME: Can't check, need to fix current behaviour (see previous FIXME comments in test cases) - /*if testCase.opts.OwnerID > 0 && !testCase.opts.Collaborate { + /*if testCase.opts.OwnerID > 0 && !testCase.opts.Collaborate && !AllPublic { assert.Equal(t, testCase.opts.OwnerID, repo.Owner.ID) }*/ |