How to run a single RSpec test?
Solution 1:
Usually I do:
rspec ./spec/controllers/groups_controller_spec.rb:42
Where 42
represents the line of the test I want to run.
EDIT1:
You could also use tags. See here.
EDIT 2:
Try:
bundle exec rspec ./spec/controllers/groups_controller_spec.rb:42
Solution 2:
With Rake:
rake spec SPEC=path/to/spec.rb
(Credit goes to this answer. Go vote him up.)
EDIT (thanks to @cirosantilli): To run one specific scenario within the spec, you have to supply a regex pattern match that matches the description.
rake spec SPEC=path/to/spec.rb \
SPEC_OPTS="-e \"should be successful and return 3 items\""