aboutsummaryrefslogtreecommitdiffstats
path: root/models/org_test.go
diff options
context:
space:
mode:
authorDavid Svantesson <davidsvantesson@gmail.com>2019-11-20 12:27:49 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2019-11-20 19:27:49 +0800
commit69a255defbf2747b066b2aeee66ba76cdd37104d (patch)
tree8cc6f166c06ff9ac334b3f5f69476fa4394ae6a2 /models/org_test.go
parent35c3ea952a6eb558e69de55fc94d301676feb935 (diff)
downloadgitea-69a255defbf2747b066b2aeee66ba76cdd37104d.tar.gz
gitea-69a255defbf2747b066b2aeee66ba76cdd37104d.zip
Team permission to create repository in organization (#8312)
* Add team permission setting to allow creating repo in organization. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add test case for creating repo when have team creation access. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * build error: should omit comparison to bool constant Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add comment on exported functions * Fix fixture consistency, fix existing unit tests * Fix boolean comparison in xorm query. * addCollaborator and changeCollaborationAccessMode separate steps More clear to use different if-cases. * Create and commit xorm session * fix * Add information of create repo permission in team sidebar * Add migration step * Clarify that repository creator will be administrator. * Fix some things after merge * Fix language text that use html * migrations file * Create repository permission -> Create repositories * fix merge * fix review comments
Diffstat (limited to 'models/org_test.go')
-rw-r--r--models/org_test.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/models/org_test.go b/models/org_test.go
index 2f2c5a2d5e..1a6b288dc7 100644
--- a/models/org_test.go
+++ b/models/org_test.go
@@ -87,10 +87,11 @@ func TestUser_GetTeams(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
org := AssertExistsAndLoadBean(t, &User{ID: 3}).(*User)
assert.NoError(t, org.GetTeams())
- if assert.Len(t, org.Teams, 3) {
+ if assert.Len(t, org.Teams, 4) {
assert.Equal(t, int64(1), org.Teams[0].ID)
assert.Equal(t, int64(2), org.Teams[1].ID)
- assert.Equal(t, int64(7), org.Teams[2].ID)
+ assert.Equal(t, int64(12), org.Teams[2].ID)
+ assert.Equal(t, int64(7), org.Teams[3].ID)
}
}
@@ -98,9 +99,10 @@ func TestUser_GetMembers(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
org := AssertExistsAndLoadBean(t, &User{ID: 3}).(*User)
assert.NoError(t, org.GetMembers())
- if assert.Len(t, org.Members, 2) {
+ if assert.Len(t, org.Members, 3) {
assert.Equal(t, int64(2), org.Members[0].ID)
- assert.Equal(t, int64(4), org.Members[1].ID)
+ assert.Equal(t, int64(28), org.Members[1].ID)
+ assert.Equal(t, int64(4), org.Members[2].ID)
}
}
@@ -395,7 +397,7 @@ func TestGetOrgUsersByOrgID(t *testing.T) {
orgUsers, err := GetOrgUsersByOrgID(3)
assert.NoError(t, err)
- if assert.Len(t, orgUsers, 2) {
+ if assert.Len(t, orgUsers, 3) {
assert.Equal(t, OrgUser{
ID: orgUsers[0].ID,
OrgID: 3,