Piotr Brudny Piotr Brudny - 1 year ago 169
HTML Question

How to test mailto link in Cucumber?

I have a link like this:

< a href= "mailto:<%= @email %>?subject=Answer to complaint&body=<%= @salutation %>,">Answer< /a>

How can I test it using Cucumber/Capybara? I mean something more than just

And I should see "Answer"

Answer Source

It sounds like you're concerned that the @email and @salutation values in the mailto: links are correct.

You can do something like this

page.should have_xpath("//a[contains(@href,email)]"))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download