title: Capybara & Rspec: How to delete an account?
body: <p>I'm using Devise and writing a test for the scenario of a user deleting their own account but I'm stuck on how I would call up the confirm box and click OK.</p>
  
  <p>Here is the link and my test:</p>
  
  <pre><code>&lt;p&gt;&lt;%= link_to "Delete my account", registration_path(resource_name), :data =&gt; { :confirm =&gt; "Are you sure?" }, :method =&gt; :delete %&gt;&lt;/p&gt;
  </code></pre>
  
  <p>spec/requests/users_spec.rb</p>
  
  <pre><code>scenario 'user deletes account' do
     make_user_and_login
     click_link('Account Settings')
     page.should have_selector('title', :text =&gt; 'Account Settings')
     click_link('Delete my account')
     # Are You Sure?
     # click OK in confirm box
     # page.should etc.....
  end
  </code></pre>
  
  <p>How would this be done?</p>