// generate some number of organization objects in JSON func generateOrganizationJson() string { jsn := u.GenerateJson( "organizations", map[string]func() interface{}{ "name": u.GenerateWord, "slug": u.GenerateSlug, "location": u.GenerateName, "default_timezone": func() interface{} { return "US/Pacific" }, }, -1, ) return jsn }
// generate some number of organization objects in JSON func generateMemberJson() string { u.InsertTestUser() u.InsertTestOrganization() u.InsertTestGame() jsn := u.GenerateJson( "members", map[string]func() interface{}{ "user_id": func() interface{} { return u.SelectTestUser().Id }, "organization_id": func() interface{} { return u.SelectTestOrganization().Id }, }, 1, ) return jsn }
// generate some number of user objects in JSON func generateGameJson() string { u.InsertTestOrganization() now := time.Now().UTC() later := now.Add(12 * time.Hour) tomorrow := now.Add(24 * time.Hour) tomorrowLater := later.Add(24 * time.Hour) jsn := u.GenerateJson( "games", map[string]func() interface{}{ "name": u.GenerateWord, "slug": u.GenerateSlug, "organization_id": getOrganizationId, "timezone": func() interface{} { return "US/Pacific" }, "registration_start_time": func() interface{} { return now.Format(time.RFC3339) }, "registration_end_time": func() interface{} { return tomorrow.Format(time.RFC3339) }, "running_start_time": func() interface{} { return later.Format(time.RFC3339) }, "running_end_time": func() interface{} { return tomorrowLater.Format(time.RFC3339) }, }, 1, ) return jsn }