-
Notifications
You must be signed in to change notification settings - Fork 47
RSpec Tips & Tricks
antislice edited this page Feb 14, 2013
·
9 revisions
RSpec is the unit testing framework that we're using.
/HelloRubyTuesdays> rspec spec/ # runs all the tests
/HelloRubyTuesdays> rspec spec/model/game_spec.rb # runs just the tests for the Game model
/HelloRubyTuesdays> rspec spec/model/game_spec.rb:3 # runs the unit test in the Game spec that's at line 3
If you get this error in some of the game controller tests:
ActionView::MissingTemplate: Missing template games/create, application/create with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :haml]}. Searched in:
* "#<RSpec::Rails::ViewRendering::EmptyTemplatePathSetDecorator:0x007ff304011108>"
It means that it expects the method that it's testing to have a redirect_to
call.