form-test-helper


Test forms easily in Ruby on Rails functional and integration tests

form-test-helper has gone on to a better place

form-test-helper was first released in September of 2006. At the time, it represented a significant step forward in testing apps with the full rails stack. I haven't updated it in quite some time, and I'm happy to see that some other tools came along and built on form-test-helper's ideas. Go check out webrat and read The Rspec Book to learn about the latest Rails tools in this vein. -- Jason Garber


This plugin uses assert_select to verify and manipulate your forms. It solves the problem we've all run into where you change the form but the test doesn't break because you're just passing parameters to an action.

Instead of this: post :create, :book => {:name => 'Pickaxe', :category => 1, :out_of_print => 0}

This plugin lets you do this: get :new submit_form do |form| form.book.name = 'Pickaxe' form.book.category = 'Programming' form.book.out_of_print.uncheck end assert_response :success

See the README file for more examples.

Installation

To install for Rails Edge (revisions 7420 and higher) use trunk:

./script/plugin install -x http://form-test-helper.googlecode.com/svn/form_test_helper/

Requires Rails trunk revision 7420 and higher

To install for Rails Edge where the edge revision ranges from 6764 to 7420 use the 1.1.1 tag:

./script/plugin install http://form-test-helper.googlecode.com/svn/tags/form_test_helper-1.1.1

Requires a Rails Edge revision inside of the range of 6764 and 7420)

To install for Rails 1.2.x use the 1.0.0 tag:

./script/plugin install http://form-test-helper.googlecode.com/svn/tags/form_test_helper-1.0.1

Requires Rails 1.2.x and higher (up to Rails Edge revision 6763)

Rdoc

Rdoc documentation for each "branch" are being hosted at rubyforge.

For form_test_helper edge:

http://continuous.rubyforge.org/form_test_helper/rdoc/

For form_test_helper 1.1.x:

http://continuous.rubyforge.org/form_test_helper-1.1.x/rdoc/

For form_test_helper 1.0.x:

http://continuous.rubyforge.org/form_test_helper-1.0.x/rdoc/

Project Information

Labels:
Rails assert_select forms