Browse the Ruby on Rails Community.

You are here: Browse Railsplugins Helper Test

Helper Test

= Helper Test Generator

Makes stubs so you can test helpers.

The helpers are placed in test/unit/helpers and will be run automatically when you run unit tests.

= Usage

Run the helper_test generator with the shortened name of the helper you want to test.

  1. For TaskHelper ./script/generate helper_test Task

Require the parent testcase class in your test_helper.rb

require File.expand_path(File.dirname(FILE) + '/helper_testcase')

The testcase includes common helpers, but you can add others if necessary.

= Examples

  1. Make a test for the BlogHelper ./script/generate helper_test Blog
  1. Make a test for Admin::UsersHelper ./script/generate helper_test Admin::Users

Sub-folders will be made, if necessary.

= Authors

  • Test stub by Ryan Davis http://zenspider.com
  • Generator by Geoffrey Grosenbach http://nubyonrails.com

NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly