diff --git a/contact_test.go b/contact_test.go index b4d8733..3138197 100644 --- a/contact_test.go +++ b/contact_test.go @@ -7,6 +7,7 @@ import ( "net/url" "strings" "testing" + "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -58,6 +59,9 @@ func Test_contact(t *testing.T) { app.sendContactSubmission(rec, req.WithContext(context.WithValue(req.Context(), blogKey, "en"))) require.Equal(t, http.StatusOK, rec.Code) + // Wait a second + time.Sleep(500 * time.Millisecond) + // Check sent mail assert.Contains(t, rd.Usernames, "user") assert.Contains(t, rd.Passwords, "pass")