This commit is contained in:
Jan-Lukas Else 2023-03-05 17:22:13 +01:00
parent 2f8dabc83e
commit 56358fff4e
1 changed files with 4 additions and 0 deletions

View File

@ -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")