Shored up test coverage.

This commit is contained in:
Patrick Fairbank
2014-09-05 22:17:12 -07:00
parent 6b25b55cb7
commit 316bd7f107
12 changed files with 178 additions and 32 deletions

View File

@@ -38,9 +38,13 @@ func TestSetupSchedule(t *testing.T) {
assert.Contains(t, recorder.Body.String(), "2014-01-02 11:48:00") // Last match of second block.
assert.Contains(t, recorder.Body.String(), "2014-01-03 16:54:00") // Last match of third block.
// Save schedule.
// Save schedule and check that it is published to TBA.
tbaBaseUrl = "fakeurl"
eventSettings.TbaPublishingEnabled = true
recorder = postHttpResponse("/setup/schedule/save", "")
matches, err := db.GetMatchesByType("qualification")
assert.Equal(t, 500, recorder.Code)
assert.Contains(t, recorder.Body.String(), "Failed to publish matches")
assert.Nil(t, err)
assert.Equal(t, 64, len(matches))
assert.Equal(t, 1388595600, matches[0].Time.Unix())