Jason Meridth's Blog Learn, Converse, Share

Run a Specific RSpec Spec

Tired of looking this up and want to use my writing part of my brain to blog it:

rake spec SPEC=spec/controllers/sessions_controller_spec.rb \
  SPEC_OPTS="-e \"should log in with cookie\""

This is importatnt to me while coding Rails because if I just run

rspec specs/controllers/sessions_controller_spec.rb

the test database isn’t cleared out. By running rake spec I get that.

Have feedback on this post? Let @jmeridth know on Twitter.