Method: EmailSpec::Helpers#click_email_link_matching
- Defined in:
- lib/email_spec/helpers.rb
#click_email_link_matching(regex, email = current_email) ⇒ Object
21 22 23 24 25 |
# File 'lib/email_spec/helpers.rb', line 21 def click_email_link_matching(regex, email = current_email) url = links_in_email(email).detect { |link| link =~ regex } raise "No link found matching #{regex.inspect} in #{email.default_part_body}" unless url visit request_uri(url) end |