Skip to content

Commit

Permalink
add the features for following links in emails
Browse files Browse the repository at this point in the history
  • Loading branch information
UnderpantsGnome authored and ianwhite committed Feb 25, 2010
1 parent 70b4e00 commit 6be243a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion features/email/email.feature
Expand Up @@ -36,4 +36,25 @@ Feature: I can test emails are sent
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
And the email should link to the user's page

Scenario: Following the first link in an email
Given a user exists with name: "Fred", email: "fred@gmail.com"
And an email "cool" with body: "some text <a href='http://example.com/users/1'>example page</a> more text" is delivered to fred@gmail.com
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

Scenario: Following a link in an email by url
Given a user exists with name: "Fred", email: "fred@gmail.com"
And an email "cool" with body: "some text <a href='http://example.com/users/1'>example page</a> more text" is delivered to fred@gmail.com
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

Scenario: Following a link in an email by the text
Given a user exists with name: "Fred", email: "fred@gmail.com"
And an email "cool" with body: "some text <a href='http://example.com/users/1'>example page</a> more text" is delivered to fred@gmail.com
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
2 changes: 1 addition & 1 deletion rails_generators/pickle/templates/email_steps.rb
Expand Up @@ -22,7 +22,7 @@
visit_in_email(email(email_ref), link)
end

When(/^(?:I|they) click the first link in #{capture_email}$/) do
When(/^(?:I|they) click the first link in #{capture_email}$/) do |email_ref|
click_first_link_in_email(email(email_ref))
end

Expand Down

0 comments on commit 6be243a

Please sign in to comment.