In my rails application, I have a page with a link that execute a javascript function :
<%= link_to_function("Add an address", "add_fields(this)".html_safe) %>
In my cucumber feature I have :
And I press "Add an address"
And the message I get is :
Capybara::ElementNotFound: no button with value or id or text 'Add an address' found
I’m probably missing something, but I can’t find what it is..
You should do one, and only one, of the following:
Add to your button an id, and also change the test, like this:
view
= f.submit ‘Save’, :id => :foo
test
And I press “foo”