Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsvantesson committed Nov 12, 2019
1 parent 1c58cba commit 55f7cb3
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions integrations/api_repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ func TestAPIOrgRepoCreate(t *testing.T) {
{ctxUserID: 1, orgName: "user3", repoName: "repo-admin", expectedStatus: http.StatusCreated},
{ctxUserID: 2, orgName: "user3", repoName: "repo-own", expectedStatus: http.StatusCreated},
{ctxUserID: 2, orgName: "user6", repoName: "repo-bad-org", expectedStatus: http.StatusForbidden},
{ctxUserID: 27, orgName: "user3", repoName: "repo-creator", expectedStatus: http.StatusCreated},
{ctxUserID: 27, orgName: "user6", repoName: "repo-not-creator", expectedStatus: http.StatusForbidden},
{ctxUserID: 28, orgName: "user3", repoName: "repo-creator", expectedStatus: http.StatusCreated},
{ctxUserID: 28, orgName: "user6", repoName: "repo-not-creator", expectedStatus: http.StatusForbidden},
}

prepareTestEnv(t)
Expand Down
8 changes: 4 additions & 4 deletions models/fixtures/user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
avatar: avatar3
avatar_email: user3@example.com
num_repos: 3
num_members: 2
num_teams: 3
num_members: 3
num_teams: 4

-
id: 4
Expand Down Expand Up @@ -102,8 +102,8 @@
avatar: avatar6
avatar_email: user6@example.com
num_repos: 0
num_members: 1
num_teams: 1
num_members: 2
num_teams: 2

-
id: 7
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion models/org_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestUser_GetMembers(t *testing.T) {
assert.NoError(t, org.GetMembers())
if assert.Len(t, org.Members, 3) {
assert.Equal(t, int64(2), org.Members[0].ID)
assert.Equal(t, int64(27), org.Members[1].ID)
assert.Equal(t, int64(28), org.Members[1].ID)
assert.Equal(t, int64(4), org.Members[2].ID)
}
}
Expand Down
4 changes: 2 additions & 2 deletions models/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ func TestSearchUsers(t *testing.T) {
}

testUserSuccess(&SearchUserOptions{OrderBy: "id ASC", Page: 1},
[]int64{1, 2, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 24, 27})
[]int64{1, 2, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 24, 27, 28})

testUserSuccess(&SearchUserOptions{Page: 1, IsActive: util.OptionalBoolFalse},
[]int64{9})

testUserSuccess(&SearchUserOptions{OrderBy: "id ASC", Page: 1, IsActive: util.OptionalBoolTrue},
[]int64{1, 2, 4, 5, 8, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 24, 27})
[]int64{1, 2, 4, 5, 8, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 24, 28})

testUserSuccess(&SearchUserOptions{Keyword: "user1", OrderBy: "id ASC", Page: 1, IsActive: util.OptionalBoolTrue},
[]int64{1, 10, 11, 12, 13, 14, 15, 16, 18})
Expand Down
12 changes: 6 additions & 6 deletions models/userlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func TestUserListIsPublicMember(t *testing.T) {
orgid int64
expected map[int64]bool
}{
{3, map[int64]bool{2: true, 4: false, 27: true}},
{6, map[int64]bool{5: true, 27: true}},
{3, map[int64]bool{2: true, 4: false, 28: true}},
{6, map[int64]bool{5: true, 28: true}},
{7, map[int64]bool{5: false}},
{25, map[int64]bool{24: true}},
{22, map[int64]bool{}},
Expand All @@ -43,8 +43,8 @@ func TestUserListIsUserOrgOwner(t *testing.T) {
orgid int64
expected map[int64]bool
}{
{3, map[int64]bool{2: true, 4: false, 27: false}},
{6, map[int64]bool{5: true, 27: false}},
{3, map[int64]bool{2: true, 4: false, 28: false}},
{6, map[int64]bool{5: true, 28: false}},
{7, map[int64]bool{5: true}},
{25, map[int64]bool{24: false}}, // ErrTeamNotExist
{22, map[int64]bool{}}, // No member
Expand All @@ -69,8 +69,8 @@ func TestUserListIsTwoFaEnrolled(t *testing.T) {
orgid int64
expected map[int64]bool
}{
{3, map[int64]bool{2: false, 4: false, 27: false}},
{6, map[int64]bool{5: false, 27: false}},
{3, map[int64]bool{2: false, 4: false, 28: false}},
{6, map[int64]bool{5: false, 28: false}},
{7, map[int64]bool{5: false}},
{25, map[int64]bool{24: true}},
{22, map[int64]bool{}},
Expand Down

0 comments on commit 55f7cb3

Please sign in to comment.