-
Notifications
You must be signed in to change notification settings - Fork 146
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
Showing
1 changed file
with
11 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,8 @@ Date: Thu, 6 Mar 2014 00:37:52 +0000 | |
Testing some Mailgun MIME awesomeness! | ||
` | ||
templateText = "Greetings %recipient.name%! Your reserved seat is at table %recipient.table%." | ||
exampleDomain = "testDomain" | ||
exampleAPIKey = "testAPIKey" | ||
) | ||
|
||
func TestGetStoredMessage(t *testing.T) { | ||
|
@@ -377,22 +379,25 @@ func TestSendMGMessageVariables(t *testing.T) { | |
} | ||
|
||
func TestAddRecipientsError(t *testing.T) { | ||
var err error | ||
m := NewMessage(fromUser, exampleSubject, exampleText) | ||
|
||
mg := NewMailgun(exampleDomain, exampleAPIKey) | ||
m := mg.NewMessage(fromUser, exampleSubject, exampleText) | ||
|
||
for i := 0; i < 1000; i++ { | ||
recipient := fmt.Sprintf("recipient_%[email protected]", i) | ||
err = m.AddRecipient(recipient) | ||
ensure.Nil(t, err) | ||
ensure.Nil(t, m.AddRecipient(recipient)) | ||
} | ||
|
||
err = m.AddRecipient("[email protected]") | ||
err := m.AddRecipient("[email protected]") | ||
ensure.NotNil(t, err) | ||
ensure.DeepEqual(t, err.Error(), "recipient limit exceeded (max 1000)") | ||
} | ||
|
||
func TestAddRecipientAndVariablesError(t *testing.T) { | ||
var err error | ||
m := NewMessage(fromUser, exampleSubject, exampleText) | ||
|
||
mg := NewMailgun(exampleDomain, exampleAPIKey) | ||
m := mg.NewMessage(fromUser, exampleSubject, exampleText) | ||
|
||
for i := 0; i < 1000; i++ { | ||
recipient := fmt.Sprintf("recipient_%[email protected]", i) | ||
|