I am using Ruby on Rails 3.2.2, cucumber-rails-1.3.0, rspec-rails-2.8.1 and capybara-1.1.2. By using Capybara I would like to check if a HTML form
is submitting to the proper URL; that is, to check if the related action="<PATH>"
HTML "tag"/"property" is what I expect it to be.
For example, in the following code I would like to check if the <PATH>
is /users
(the full HTML is action="/users"
) where the Ruby on Rails route is new_user_path
:
<form method="post" id="css_form_id" action="/users">
...
</form>
At this time, in order to check if the form is present on the page, I am using the following code:
Then /^I should see the form$/ do
page.should have_selector('form#css_form_id', :visible => true)
end
Is it possible to check if the form
is submitting to the proper URL? If so, how can I make that? What do you advice about?