Peter Marklund's Home |
Rails Testing: The form_test_helper Plugin
I've been using the form_test_helper plugin in my integration tests lately and I think it's a great way to increase test coverage of your views. The form_test_helper uses the assert_select CSS-like selectors and makes it easy to click links and submit forms and thus simulate something that comes pretty close to manual testing in the browser, unless of course you need to test AJAX functionality, in which case you need to look at Watir or Selenium. Here is some sample code: