Capybara & Rspec: Jak usunąć konto?
Używam Devise i piszę test dla scenariusza usunięcia własnego konta przez użytkownika, ale utknąłem na tym, jak wywołać okno potwierdzenia i kliknąć OK.
Oto link i mój test:
<p><%= link_to "Delete my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %></p>
spec / requests / users_spec.rb
scenario 'user deletes account' do
make_user_and_login
click_link('Account Settings')
page.should have_selector('title', :text => 'Account Settings')
click_link('Delete my account')
# Are You Sure?
# click OK in confirm box
# page.should etc.....
end
Jak by to zrobić?