I have a test using Cucumber, capybara and selenium driver. This test should go to a form and submit it. The normal text would be
Scenario: Fill form
Give
I just had to solve this problem myself. In webrat I had something like this:
Then /^I submit the "([^\"]*)" form$/ do |form_id|
submit_form form_id
end
I was able to achieve the same thing with this in Capybara:
Then /^I submit the "([^\"]*)" form$/ do |form_id|
element = find_by_id(form_id)
Capybara::RackTest::Form.new(page.driver, element.native).submit :name => nil
end