Capybara and formation

I have a simple form with one email field and two submit buttons.

The first "Next" button launches the default action for the forms: '/ login'. The second 'Reset Password' button has a 'formaction' element that redirects the form to the new destination: '/ reset_password'.

<button type="submit" name="login_button">Next</button>
<button class="secondary_button" type="submit" name="reset_button" formaction="/reset_password">Reset Password</button>

The form works fine, however when testing with Capybara:

click_button "Reset Password"

it triggers the default action for the form, not the correct action. I have confirmed that the default action is triggered with:

save_and_show_page

This definitely calls the correct button, but seems to ignore the "formula."

Any ideas?

+3
source share
1 answer

, , , HTML5, Capybara RackTtest / ( , JS-), . , , PhantomJS (http://phantomjs.org/index.html). HTML5.

0

All Articles