An RSpec matcher that checks views for the presence of a form, including
the presence of specified input fields that should be within the form tag.
This can be especially useful to test forms that submit to an external
website and thus cannot be included in a Cucumber story.
An alternative syntax using a block is available, which is more suitable
to check complex forms. Note the use of curly braces instead of do ... end,
to make sure that the block binds to the have_form call.
See the spec/form_matcher_spec.rb file for more examples.
== Supported checks
have_form(method => action) {
form.hidden('name') # hidden field with name 'name'
form.hidden('name', 'value') # field with value
form.text('username') # named text input
form.text('username', 'default') # checks default value
form.password('password') # named password field
form.checkbox('name', 'value') # checkbox with value
form.checkbox('name[]', 'value1', 'value2') # array of checkboxes
form.radio('name', 'value1', 'value2', ...) # radiobuttons
form.submit_button # makes sure the form can be submitted
}
FAQs
Unknown package
We found that wvanbergen-rspec_form_matcher demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.
Package last updated on 10 Aug 2014
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.