So, I want to check how a user deletes his account using capybara and rspec:
scenario "User wants to delete their account" do
click_link "Account"
click_link "Delete My Account"
expect(page).to have_text("You're account was deleted.")
end
Only problem is the js confirmation dialog when the user clicks โdelete my accountโ. To confirm this dialog box, I did the following:
- Install capybara-webkit
- add
Capybara.javascript_driver = :webkitto my spec_helper.rb - add
:js => truein scenario "User wants to delete their account" do.
Now nothing works with the add :js => true. Am I getting an error Capybara::ElementNotFound: Unable to find link "Account"and, before it works fine, js: trueinterferes with these capybara methods? Is my configuration wrong?
source
share