Note that there are some explanatory texts on larger screens.

plurals
  1. POTesting "Account Confirmation" with rails/rspec/capybara/devise
    primarykey
    data
    text
    <p>I'm using rspec/capybara/devise to conduct Integration testing in an app. One of the features of the app is the ever-populate "Account Registration" using a confirm feature (ie sign up - get an confirmation email - click on the link - account is validated).</p> <pre><code>require 'spec_helper' describe "User Authentication" do describe "New user" do before(:each) do @user = Factory.build(:user) end it "can confirm account by clicking on confirmation link" do visit root_path click_link "Register" page.should have_content "Register for an account" fill_in "user_email", :with =&gt; @user.email fill_in "user_password", :with =&gt; @user.password fill_in "user_password_confirmation", :with =&gt; @user.password fill_in "user_first_name", :with =&gt; @user.first_name fill_in "user_last_name", :with =&gt; @user.last_name fill_in "user_city", :with =&gt; @user.city fill_in "user_province", :with =&gt; @user.province fill_in "user_country", :with =&gt; @user.country fill_in "user_expertise", :with =&gt; @user.expertise choose "user_experience_professional" click_button "Go!" last_email.to.should include(@user.email) end end end </code></pre> <p>Here are my helpers:</p> <pre><code>module MailerMacros def last_email ActionMailer::Base.deliveries.last end end </code></pre> <p>The confirmation link is in the HTML email generated. It would be lovely to be able to do something like this (assuming "Confirm My Account") is the link to the account validation.</p> <pre><code>last_email.body.find_link("Confirm My Account").click_link </code></pre> <p>Does anyone have any suggestions in being able to identify links in an email that could go into a request_spec?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload