I am upgrading from rails 3.2.19 to rails 4.1.5, using rspec-rails 2.14.0.rc1 and capybara 2.4.1. All tests pass, and I only have one deprecation warning left:
I replaced page.driver.accept_js_confirms! with:
page.execute_script('window.confirm = function() { return true }')
And the test passed.
This was from the documentation here: http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Session#evaluate_script-instance_method
And help from the internets. Now, that doesn't still tell us how to use accept_confirm so I'm still looking for that answer.
The actual code looks like this:
# Execute the block, accepting a confirm.
#
# @macro modal_params
#
def accept_confirm(text_or_options=nil, options={}, &blk)
if text_or_options.is_a? Hash
options=text_or_options
else
options[:text]=text_or_options
end
driver.accept_modal(:confirm, options, &blk)
end
Honestly, I think it's just page.accept_confirm with SOMETHING else, but I can't figure out what or passing in that block.