daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Feb 23rd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <p><%= link_to "Delete my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %></p>
  2.    
  3. scenario 'user deletes account' do
  4.    make_user_and_login
  5.    click_link('Account Settings')
  6.    page.should have_selector('title', :text => 'Account Settings')
  7.    click_link('Delete my account')
  8.    # Are You Sure?
  9.    # click OK in confirm box
  10.    # page.should etc.....
  11. end
  12.    
  13. page.driver.browser.switch_to.alert.accept
  14.    
  15. page.driver.browser.switch_to.alert.dismiss
  16.    
  17. page.evaluate_script('window.confirm = function() { return true; }')
  18.    
  19. page.should have_content "Account deleted"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top