aboutsummaryrefslogtreecommitdiffstats
path: root/models/org_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-10-25 01:36:19 +0800
committerLauris BH <lauris@nix.lv>2017-10-24 20:36:19 +0300
commit6eeadb2082193f8e3dc5269dfc6da2daef7eb6a1 (patch)
treed28d3be3451194e98a5c01097347e7eebdb6393f /models/org_test.go
parent03900303a9500b33b33ff03fd6dd325147a1117e (diff)
downloadgitea-6eeadb2082193f8e3dc5269dfc6da2daef7eb6a1.tar.gz
gitea-6eeadb2082193f8e3dc5269dfc6da2daef7eb6a1.zip
Hide unactive on explore users and some refactors (#2741)
* hide unactive on explore users and some refactors * fix test for removed Organizations * fix test for removed Organizations * fix imports * fix logic bug * refactor the toConds * Rename TestOrganizations to TestSearchUsers and add tests for users * fix other tests * fix other tests * fix watchers tests * fix comments and remove unused code
Diffstat (limited to 'models/org_test.go')
-rw-r--r--models/org_test.go21
1 files changed, 0 insertions, 21 deletions
diff --git a/models/org_test.go b/models/org_test.go
index c7bdb8b5d3..8f59af0744 100644
--- a/models/org_test.go
+++ b/models/org_test.go
@@ -237,27 +237,6 @@ func TestCountOrganizations(t *testing.T) {
assert.Equal(t, expected, CountOrganizations())
}
-func TestOrganizations(t *testing.T) {
- assert.NoError(t, PrepareTestDatabase())
- testSuccess := func(opts *SearchUserOptions, expectedOrgIDs []int64) {
- orgs, err := Organizations(opts)
- assert.NoError(t, err)
- if assert.Len(t, orgs, len(expectedOrgIDs)) {
- for i, expectedOrgID := range expectedOrgIDs {
- assert.EqualValues(t, expectedOrgID, orgs[i].ID)
- }
- }
- }
- testSuccess(&SearchUserOptions{OrderBy: "id ASC", Page: 1, PageSize: 2},
- []int64{3, 6})
-
- testSuccess(&SearchUserOptions{OrderBy: "id ASC", Page: 2, PageSize: 2},
- []int64{7, 17})
-
- testSuccess(&SearchUserOptions{Page: 3, PageSize: 2},
- []int64{})
-}
-
func TestDeleteOrganization(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
org := AssertExistsAndLoadBean(t, &User{ID: 6}).(*User)