Logo: Relish

  1. Sign in

Project: Pickle

I can test emails are sent

In order write features with emails as outcomes
As a feature writer
I want to easily see what emails have been delivered

Scenarios
Deliver an email, and test it's properties
Given
an email "Gday" with body: "Gday Mate" is delivered to [email protected]
Then
1 email should be delivered
And
the email should not be delivered to "[email protected]"
And
the email should have subject: "Gday", to: "[email protected]"
And
the email should contain "Mate"
And
the email should not contain "Foo"
Deliver some emails, restrict scope
Given
an email "cool" with body: "body1" is delivered to [email protected]
And
an email "tasty" with body: "body2" is delivered to [email protected]
And
an email "cool" with body: "body3" is delivered to [email protected]
Then
2 emails should be delivered to [email protected]
And
the 1st email should have subject: "cool"
And
the 2nd email should have subject: "tasty"
And
2 emails should be delivered with subject: "cool"
And
the 1st email should be delivered to [email protected]
And
the 2nd email should be delivered to [email protected]
And
1 email should be delivered with subject: "cool", to: "[email protected]"
Deliver some emails, reset deliveries
Given
an email "cool" with body: "body1" is delivered to [email protected]
And
all emails have been delivered
Then
0 emails should be delivered
Deliver emails to user
Given
a user exists with name: "Fred", email: "[email protected]"
And
the user's email is delivered
Then
1 email should be delivered to the user
And
the email should contain "Dear Fred"
And
the email should link to the user's page
Given
a user exists with name: "Fred", email: "[email protected]"
And
an email with a link "example page" to the user's page is delivered to [email protected]
Then
1 email should be delivered to the user
And
I click the first link in the email
Then
I should be at the user's page
Given
a user exists with name: "Fred", email: "[email protected]"
And
an email with a link "example page" to the user's page is delivered to [email protected]
Then
1 email should be delivered to the user
And
I follow "example.com/" in the email
Then
I should be at the user's page
Given
a user exists with name: "Fred", email: "[email protected]"
And
an email with a link "example page" to the user's page is delivered to [email protected]
Then
1 email should be delivered to the user
And
I follow "example page" in the email
Then
I should be at the user's page
Save and open email
Given
an email "Gday" with body: "Gday Mate" is delivered to [email protected]
Then
show me the email

Last published over 6 years ago by ianwhite.