Skip to content

Commit

Permalink
Fix messages test after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
thrawn01 committed Jan 15, 2019
1 parent ae1797d commit 558e270
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions messages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 558e270

Please sign in to comment.