form_test_helper, select_form update
on April 02, 2008 @ 05:28 PM
Revision 71 of form_test_helper includes a bug fix for the select_form method. Previously calling select_form with a block would submit the form. The fix forces you to call submit on the form. So…
1 2 3 4 5 6 7 8 9 10 |
# THIS which used to submit the form form = select_form 'trip' do |form| form.trip.destination = "bahamas" end # WILL NOW LOOK LIKE THIS form = select_form 'trip' do |form| form.trip.destination = "bahamas" end form.submit |
This doesn’t affect the usage of submit_form which still acts as expected.
This will be included in the next release of form_test_helper. Currently trunk for form_test_helper works with Rails 2.0.0 and higher (including today’s most recent trunk commit).
The form_test_helper edge docs have been updated as well and can be found here
form_test_helper edge gets support for multiple submit buttons
on November 27, 2007 @ 11:49 AM
form_test_helper edge has been updated to support multiple submit buttons on a form. It also includes a fix to avoid namespace collisions if models are named Select, Option, etc.
If you have a view which looks like:
1 2 3 4 |
<form id="test"> <input type="submit" value="yes" /> <input type="submit" value="no" /> </form> |
You can have choose which value to submit when the form is submitted:
1 2 3 4 5 6 7 8 9 10 11 |
# selecting the form and submitting it in separate steps form = select_form "test", :submit_value => "yes" form.submit # submitting a form with a submit value in one step submit_form "test", :submit_value => "yes" # submitting a form with a submit value in one step using a block submit_form "test", :submit_value => "yes" do |form| # .. end |
You don’t have to supply a :submit_value. If you don’t the first submit value found on the form will be used. If you try to supply a non-existent value then an exception will raised.
For example:
1 2 3 |
# trying to submit on a non-existent input value form = select_form "test", :submit_value => "fooey" form.submit # => raises a FormTestHelper::Form::MissingSubmitError |
Installing
As an external:
./script/plugin install -x http://form-test-helper.googlecode.com/svn/form_test_helper |
Not as an external:
./script/plugin install http://form-test-helper.googlecode.com/svn/form_test_helper |
With piston:
1 2 |
cd vendor/plugins/ piston import http://form-test-helper.googlecode.com/svn/form_test_helper |
Rdoc
Rdoc pages for form_test_helper edge are hosted on rubyforge. You can find them at http://continuous.rubyforge.org/form_test_helper/rdoc/
If you have any questions feel free to ask. If you find issues, bugs or odd behavior please create an issue over at http://code.google.com/p/form-test-helper/
form_test_helper 1.0.1 and 1.1.1
on November 27, 2007 @ 11:07 AM
form_test_helper 1.0.1 and 1.1.1 have been released.
- 1.0.1 is for people who are on 1.2.x (specifically 1.2.5 and 1.2.6)
- 1.1.1 is for people who are on a Rails Edge revision between 6764 and 7420
If you are on Rails Edge newer then 7420 then you’ll want to use form_test_helper edge. A separate announcement will be made for that release.
The 1.0.1 and 1.1.1 releases fix a namespace collision issue if you happen to have a model named Option or Select. Thanks to Tomasz Wegrzanowski for pointing this out and supplying a patch.
For information on how-to install, or for usage examples please check out the rdoc for these releases:
This will probably be the last release for the 1.1.x branch of development since it targets such as a small set of revisions on Rails Edge and it will be out of date shortly if it isn’t already.
form_test_helper 1.1.0 released!
on September 20, 2007 @ 12:22 AM
form_test_helper 1.1.0 has been released!
This update is for those who develop on Rails Edge. A recent update to Rails broke break how the tests run with form_test_helper.
So if you are on an Rails Edge revision of 7421 or higher then you should use form_test_helper trunk. The plugin repository URL is:
If you are on Rails Edge, but you’re not up to revision 7421 yet you will want to install and use form_test_helper-1.1.0. The plugin repository URL is:
If you are using Rails 1.2.x or a Rails Edge revision that is less then 6474 then you should use form_test_helper-1.0.0. The plugin repository URL is:
For more information please refer to the form_test_helper project page:
form_test_helper on edge
on September 01, 2007 @ 11:28 PM
Well I’ve joined the Google Code project for form_test_helper . So form_test_helper will now work with Rails Edge, trunk revisions 6764 all the way up to 7393 (todays latest commit).
If you are using Rails 1.2.x or a Rails Edge revision less then 6764 then please use the 1.0.0 tag for form_test_helper, otherwise use what we consider form_test_helper trunk.
Installing for Rails Edge greater than or equal to 6764
script/plugin install http://form-test-helper.googlecode.com/svn/form_test_helper
Installing for Rails Edge less than 6764
script/plugin install http://form-test-helper.googlecode.com/svn/tags/form_test_helper-1.0.0
I am going to put these notes on the project home page as soon as I get permissions to make that update if Jason doesn’t make the change himself.
Enjoy form_test_helper on Edge!


