Beispiel #1
0
func createTeam(ctx *_Context) error {
	req := ctx.req.(*_TeamCreateReq)
	user, team, err := biz.CreateTeam(req.Name, req.Telephone)
	if err != nil {
		return err
	}
	afterTeamJoinCreate(ctx, user, team)
	return nil
}
Beispiel #2
0
func TestCreateTeam(t *T) {
	beforeTeamTest()
	user, team, err := biz.CreateTeam("Best Team", "1231231234")
	rdtest.Assert(t, err == nil, err)
	rdtest.Assert(t, user.UserId > 0, "user not saved")
	rdtest.Assert(t, team.TeamId > 0, "team not saved")
	rdtest.Assert(t, team.Phrase == "phrase_1", "wrong phrase")
	rdtest.Assert(t, team.TrackId == 1, "wrong track")
}