title: How to handle Modals in cucumber + Capybara + Selenium
body: <p>So I am trying to click a forgot password link (which causes a modal pop up) and confirm the pop up link so I can perform a test on the sent out email.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>   page.find(:css, '#launch-modal-link').click  # code fails on this line, after clicking the link
  
     page.driver.browser.switch_to.alert.accept  # does not get to this line of code.
  </code></pre>
  
  <p>What am I doing wrong exactly when trying to click the "Ok" button in the modal pop up?</p>
  
  <p>Do I need to add a try catch block (or whatever it is called in Ruby) around the link </p>