Creating Test Templates
The most basic way to create test templates is to use the regular procedure of creating files in project. This means is available for both plain Ruby projects, and for the Rails applications, and allows creating stub tests for Test::Unit, RSpec and Test-Spec.
For RSpec and Test-Spec RubyMine provides a number of generators. These generators are context-sensitive, and become available depending on the selected location, and on the gems activated for your project. For example, if rspec-rails is activated, the usual generators are hidden, and the list of generators includes only those specific for RSpec.
Creating test templates
To create a test template, follow these general steps
Select the target location in the Project tool window.
In the New pop-up menu, select the desired test template:
For an RSpec or Test-Spec test templates, specify the names for the test file, behavior, and "should". For a TestUnit test template, specify the name for the file and test case.
Generating RSpec or Test-Spec test templates
To generate a RSpec or Test-Spec test template, follow these general steps
In the Generate pop-up menu, select the desired test template.
Specify the test generator arguments, if any, and options, and click OK. The respective generator script is executed, and displays its output in the console tab of the Run tool window.