-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add test for api team organization #24699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
03e103e
d0b4b4a
d9f9668
0c9561c
3f1b511
2ee2d6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ func TestAPITeam(t *testing.T) { | |
|
||
teamUser := unittest.AssertExistsAndLoadBean(t, &organization.TeamUser{ID: 1}) | ||
team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamUser.TeamID}) | ||
org := unittest.AssertExistsAndLoadBean(t, &organization.Organization{ID: teamUser.OrgID}) | ||
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: teamUser.UID}) | ||
|
||
session := loginUser(t, user.Name) | ||
|
@@ -40,6 +41,7 @@ func TestAPITeam(t *testing.T) { | |
DecodeJSON(t, resp, &apiTeam) | ||
assert.EqualValues(t, team.ID, apiTeam.ID) | ||
assert.Equal(t, team.Name, apiTeam.Name) | ||
assert.EqualValues(t, convert.ToOrganization(db.DefaultContext, org), apiTeam.Organization) | ||
|
||
// non team member user will not access the teams details | ||
teamUser2 := unittest.AssertExistsAndLoadBean(t, &organization.TeamUser{ID: 3}) | ||
|
@@ -58,7 +60,7 @@ func TestAPITeam(t *testing.T) { | |
session = loginUser(t, user.Name) | ||
token = getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeAdminOrg) | ||
|
||
org := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 6}) | ||
org = unittest.AssertExistsAndLoadBean(t, &organization.Organization{ID: 6}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The previous |
||
|
||
// Create team. | ||
teamToCreate := &api.CreateTeamOption{ | ||
|
Uh oh!
There was an error while loading. Please reload this page.