[rspec-users] How to spec error_messages_for

Ashley Moran work at ashleymoran.me.uk
Wed Mar 21 13:03:46 EDT 2007


Hi

I'm trying to spec a call to error_messages_for to avoid stubbing out  
whole models.  Something like this:

context "A rendered calculate_quote view" do
   setup do
     @form = mock("form")
     assigns[:form] = @form
   end

   specify "should render the error messages" do
     <SOMETHING>.should_receive(:error_messages_for).with 
('form', :anything)
     render 'gap/calculate_quote'
   end
end

What can I put as <SOMETHING>?

Thanks...
Ashley


More information about the rspec-users mailing list