On 13/02/2009, at 7:26 PM, Fernando Perez wrote:
How do you spec protected controller methods such as before_filters
and
helpers that with the params and session hashes?
I cannot call controller.my_method if my_method is protected.
Try this:
controller.andreplace("foo and bar").should eql("+foo +bar")
Hey Fernando. As Mark said, the idea behind BDD is to spec the
behaviour of your controller, rather than each specific method. So
write specs for all of the different behaviours that your controller
can exhibit. This will result in your protected and private methods
being called.
Cheers,
Nick
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users