I wish to click a popup message that appears on my test app if it is present. I am new to capybara and cant seem to find a way to do this. I have previous experience with watir and if I were doing it with watir it would be something like:

if browser.link(:text, "name").exists? do
   browser.link(:text, "name").click
end

How can I do the same in capybara? Note this link will not always appear hence why I wish to have the if statement.

Edit
Report