[rspec-users] undefined local variable or method

Guirec Corbel guirec.corbel at gmail.com
Mon Jun 10 22:45:49 UTC 2013


I a controller spec like this : 
(at the top). When I try to run this spec I have this message :

Failure/Error: before { painting.stub(:valid?).and_return(true) }
undefined local variable or method ` painting' for 
# ./spec/controllers/painting_controller_spec.rb:10:in `block (4 levels) 
in <top (required)>' But this spec : 
(at the bottom) works perfectly. In the context's before block, the 
painting seem not to be created. Did I do something wrong? Thanks!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20130610/76b9c198/attachment.html>

More information about the rspec-users mailing list