Skip to content

Instantly share code, notes, and snippets.

@LimeBlast
Forked from tuomasj/activation_email_spec.rb
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LimeBlast/edcfe156c5d719eaea1e to your computer and use it in GitHub Desktop.
Save LimeBlast/edcfe156c5d719eaea1e to your computer and use it in GitHub Desktop.
`have_link_ends_with` matcher
require 'spec_helper'
describe "Activation Email" do
it "confirms the email when user clicks the confirmation link on activation email" do
register_new_user("john.smith@example.com", "adobe password", "adobe password")
activation_token = User.last.activation_code
expect( open_last_email.default_part_body ).to have_link_with_ends_with(activation_token)
visit activation_path(activation_token)
expect(page).to have_content( "Your email has been confirmed.")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment