Email content matching problem

12 views
Skip to first unread message

David Tuite

unread,
Jul 22, 2011, 6:26:41 AM7/22/11
to pickle
I'm having an issue matching content or link text in email with the
pickle email steps matchers.

This is my cuke test:

Background:
Given all emails have been delivered

Scenario: inviting people into an existant team
Given I have registered and am signed in
When I go to my team's page
And I fill in "invitation_recipient_name" with "Mark"
And I fill in "invitation_recipient_email" with "ma...@mark.com"
And I press "Invite!"
Then I should see "Invitation sent"
And I should have 1 sent invitations
And 1 email should be delivered to "ma...@mark.com"
When they follow "Click here to accept" in the last email

This fails at the step "When they follow "Click here to accept" in the
last email" with the long error message I've posted below. I can see
the "Click here to accept" link in the error text and I know from
doing it in the browser that it does exist and works as expected. Is
there something I'm doing wrong?

When they follow "Click here to accept" in the last email #
features/step_definitions/email_steps.rb:21
No link found matching "Click here to accept" in Date: Fri, 22
Jul 2011 11:20:32 +0100
From: invit...@grouperty-stage.heroku.com
To: ma...@mark.com
Message-ID: <4e294ef027181_59d80443b3c96614@David-Tuites-MacBook-
Pro.local.mail>
Subject: David Tuite would like you to join their team on
Grouperty
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_4e294ef0b52a_59d80443b3c9635f";
charset=UTF-8
Content-Transfer-Encoding: 7bit



----==_mimepart_4e294ef0b52a_59d80443b3c9635f
Date: Fri, 22 Jul 2011 11:20:32 +0100
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <4e294ef01a53b_59d80443b3c96448@David-Tuites-MacBook-
Pro.local.mail>

Hi Mark
====================================

David Tuite has invited you to join his team.
<a href="http://grouperty-stage.heroku.com/invitations/266/
accept/a6d6b20346f2c8c20f18a044ec8d7b5c900d3b55">Click here to accept</
a>.

Thanks for joining and have a great day!


----==_mimepart_4e294ef0b52a_59d80443b3c9635f
Date: Fri, 22 Jul 2011 11:20:32 +0100
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <4e294ef02271c_59d80443b3c96578@David-Tuites-MacBook-
Pro.local.mail>

<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-
Type" />
</head>
<body>
<h1>Hi Mark</h1>
<p>
David Tuite has invited you to join his team.
</p>
<p>
<a href="http://grouperty-stage.heroku.com/invitations/266/
accept/a6d6b20346f2c8c20f18a044ec8d7b5c900d3b55">Click here to accept</
a>
</p>
<p>Thanks for joining and have a great day!</p>
</body>
</html>


----==_mimepart_4e294ef0b52a_59d80443b3c9635f--
(RuntimeError)
./features/step_definitions/email_steps.rb:22:in `/^(?:I|they)
follow "([^"]*?)" in ((?:(?:(?:a|an|another|the|that) )?(?:(?:first|
last|(?:\d+(?:st|nd|rd|th))) )?email))$/'
features/invitation_management.feature:18:in `When they follow
"Click here to accept" in the last email'

Failing Scenarios:
cucumber features/invitation_management.feature:9 # Scenario: inviting
people into an existant team

David Tuite

unread,
Jul 22, 2011, 6:40:11 AM7/22/11
to pickle
Perhaps it's because the hosts don't match in the email link?

Then again, doing a straight up - email should contain "accept" -
doesn't seem to work either.

On Jul 22, 11:26 am, David Tuite <dtu...@gmail.com> wrote:
> I'm having an issue matching content or link text in email with the
> pickle email steps matchers.
>
> This is my cuke test:
>
>   Background:
>     Given all emails have been delivered
>
>   Scenario: inviting people into an existant team
>     Given I have registered and am signed in
>     When I go to my team's page
>     And I fill in "invitation_recipient_name" with "Mark"
>     And I fill in "invitation_recipient_email" with "m...@mark.com"
>     And I press "Invite!"
>     Then I should see "Invitation sent"
>     And I should have 1 sent invitations
>     And 1 email should be delivered to "m...@mark.com"
>     When they follow "Click here to accept" in the last email
>
> This fails at the step "When they follow "Click here to accept" in the
> last email" with the long error message I've posted below. I can see
> the "Click here to accept" link in the error text and I know from
> doing it in the browser that it does exist and works as expected. Is
> there something I'm doing wrong?
>
> When they follow "Click here to accept" in the last email       #
> features/step_definitions/email_steps.rb:21
>       No link found matching "Click here to accept" in Date: Fri, 22
> Jul 2011 11:20:32 +0100
>       From: invitati...@grouperty-stage.heroku.com
>       To: m...@mark.com

David Tuite

unread,
Jul 22, 2011, 7:36:28 AM7/22/11
to pickle
Perhaps it's because the hosts don't match in the email link?

Then again, doing a straight up - email should contain "accept" -
doesn't seem to work either.

On Jul 22, 11:26 am, David Tuite <dtu...@gmail.com> wrote:
> I'm having an issue matching content or link text in email with the
> pickle email steps matchers.
>
> This is my cuke test:
>
>   Background:
>     Given all emails have been delivered
>
>   Scenario: inviting people into an existant team
>     Given I have registered and am signed in
>     When I go to my team's page
>     And I fill in "invitation_recipient_name" with "Mark"
>     And I fill in "invitation_recipient_email" with "m...@mark.com"
>     And I press "Invite!"
>     Then I should see "Invitation sent"
>     And I should have 1 sent invitations
>     And 1 email should be delivered to "m...@mark.com"
>     When they follow "Click here to accept" in the last email
>
> This fails at the step "When they follow "Click here to accept" in the
> last email" with the long error message I've posted below. I can see
> the "Click here to accept" link in the error text and I know from
> doing it in the browser that it does exist and works as expected. Is
> there something I'm doing wrong?
>
> When they follow "Click here to accept" in the last email       #
> features/step_definitions/email_steps.rb:21
>       No link found matching "Click here to accept" in Date: Fri, 22
> Jul 2011 11:20:32 +0100
>       From: invitati...@grouperty-stage.heroku.com
>       To: m...@mark.com
Reply all
Reply to author
Forward
0 new messages