-
-
Notifications
You must be signed in to change notification settings - Fork 964
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b423c88
commit 1d72d91
Showing
11 changed files
with
95 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import ( | |
"testing" | ||
"time" | ||
|
||
"github.com/gofrs/uuid" | ||
"github.com/pkg/errors" | ||
"github.com/sirupsen/logrus" | ||
"github.com/stretchr/testify/assert" | ||
|
@@ -70,7 +71,7 @@ func TestQueueEmail(t *testing.T) { | |
conf.MustSet(config.ViperKeyCourierSMTPFrom, "[email protected]") | ||
reg.Logger().Level = logrus.TraceLevel | ||
|
||
c := reg.Courier(ctx) //??? | ||
c := reg.Courier(ctx) | ||
|
||
ctx, cancel := context.WithCancel(ctx) | ||
defer cancel() | ||
|
@@ -81,15 +82,15 @@ func TestQueueEmail(t *testing.T) { | |
Body: "test-body-1", | ||
})) | ||
require.NoError(t, err) | ||
x.RequireNotNilUUID(t, id) | ||
require.NotEqual(t, uuid.Nil, id) | ||
|
||
id, err = c.QueueEmail(ctx, templates.NewTestStub(reg, &templates.TestStubModel{ | ||
To: "[email protected]", | ||
Subject: "test-subject-2", | ||
Body: "test-body-2", | ||
})) | ||
require.NoError(t, err) | ||
x.RequireNotNilUUID(t, id) | ||
require.NotEqual(t, uuid.Nil, id) | ||
|
||
// The third email contains a sender name and custom headers | ||
conf.MustSet(config.ViperKeyCourierSMTPFromName, "Bob") | ||
|
@@ -103,7 +104,7 @@ func TestQueueEmail(t *testing.T) { | |
Body: "test-body-3", | ||
})) | ||
require.NoError(t, err) | ||
x.RequireNotNilUUID(t, id) | ||
require.NotEqual(t, uuid.Nil, id) | ||
|
||
go func() { | ||
require.NoError(t, c.Work(ctx)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
test/schema/fixtures/config.schema.test.success/root.courierSMS.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
selfservice: | ||
default_browser_return_url: "#/definitions/defaultReturnTo" | ||
|
||
dsn: foo | ||
|
||
identity: | ||
schemas: | ||
- id: default | ||
url: https://example.com | ||
|
||
courier: | ||
smtp: | ||
connection_uri: smtps://foo:bar@my-mailserver:1234/ | ||
from_address: [email protected] | ||
sms: | ||
enabled: true | ||
from: "+19592155527" | ||
request_config: | ||
url: https://sms.example.com | ||
method: POST | ||
body: file://request.config.twilio.jsonnet | ||
header: | ||
'Content-Type': "application/x-www-form-urlencoded" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters