Пример #1
0
func getDashboardProgress(ctx *_Context) error {

	summaries, err := table.FindAllProgressSummaries(time.Now())
	if err != nil {
		return err
	}

	ctx.resp, err = FormatProgressSummaries(summaries)
	return err
}
Пример #2
0
func TestFindAllProgresses(t *T) {
	beforeTeamProgressTest()

	now := time.Date(2016, 06, 15, 0, 0, 0, 0, time.UTC)
	summaries, err := table.FindAllProgressSummaries(now)
	rdtest.Assert(t, err == nil, err)
	rdtest.Assert(t, len(summaries) == 3, "Summaries: %d", len(summaries))
	rdtest.Assert(t, summaries[0].Team.TeamId == 20)
	rdtest.Assert(t, summaries[1].Team.TeamId == 21)
	rdtest.Assert(t, summaries[2].Team.TeamId == 22)
}