Mocking view helpers with rspec-rails 2.0.0.b.8

I am trying to mock a view helper with rspec2. The old way to do this is throwing an error complaining that the template object is undefined:

template.should_receive(:current_user).and_return(mock("user")) 

Am I missing something, or is it not implemented in rspec2 (yet)?

+6
ruby-on-rails rspec
source share
1 answer

It revealed:

 view.should_receive(:current_user).and_return(mock("user")) 
+7
source share

All Articles