1
mirror of https://github.com/jlelse/GoBlog synced 2024-07-27 08:25:54 +00:00
This commit is contained in:
Jan-Lukas Else 2023-03-05 17:22:13 +01:00
parent 2f8dabc83e
commit 56358fff4e

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