- Make sure that the required gems are installed.
- In the Gemfile, add the line
gem 'rspec-rails'
- Generate the RSpec testing infrastructure. To do that, press Alt+InsertAlt+Insert, choose on the pop-up menu,
start typing the rspec generator name, and choose rspec:install from the list:

In the Setup RSpec Support dialog box, specify the generator options. The respective script is executed, and displays its output in the console tab of the Run tool window.
- Generate the test templates same way as the other Rails application elements.
-
Run or debug your spec.
If you are using the bundler, make sure that in the RSpec run/debug configuration the check box Run the script in context of the bundle is selected.
Note that you can execute all tests in a folder, specific test script, or individual examples in a script.- To execute all tests in a folder, in the Project tool window right-click the folder that contains specs, and choose on the context menu.
- To execute a test script, right-click the spec in the Project tool window, or open this spec in the editor and right-click somewhere outside individual examples. Then choose . on the context menu.
- To execute an individual example, open the desired spec in the editor, right-click the example to be executed, and choose



