summaryrefslogtreecommitdiffstats
path: root/models/org_test.go
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2017-07-06 15:30:19 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-07-06 21:30:19 +0800
commit30787e48f219b23701f660ba0b99b326ab82e997 (patch)
tree005dfef495149e81e78ad31c251cc3a3e2709870 /models/org_test.go
parent2ef33b53381f68dc2af88eabfe5f35c3dbc94412 (diff)
downloadgitea-30787e48f219b23701f660ba0b99b326ab82e997.tar.gz
gitea-30787e48f219b23701f660ba0b99b326ab82e997.zip
Improve org error handling (#2117)
* Improve ErrOrgNotExist type Return new error type Use good error check Use new method to check error Update tests * Fix unchanged method name report
Diffstat (limited to 'models/org_test.go')
-rw-r--r--models/org_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/org_test.go b/models/org_test.go
index 95698a58e9..801088c2e2 100644
--- a/models/org_test.go
+++ b/models/org_test.go
@@ -222,10 +222,10 @@ func TestGetOrgByName(t *testing.T) {
assert.Equal(t, "user3", org.Name)
org, err = GetOrgByName("user2") // user2 is an individual
- assert.Equal(t, ErrOrgNotExist, err)
+ assert.True(t, IsErrOrgNotExist(err))
org, err = GetOrgByName("") // corner case
- assert.Equal(t, ErrOrgNotExist, err)
+ assert.True(t, IsErrOrgNotExist(err))
}
func TestCountOrganizations(t *testing.T) {