views:

146

answers:

1

I am trying to mock a view helper with rspec2. The old way of doing this throws an error, complaining the template object is not defined:

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

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

+2  A: 

Figured out meself:

view.should_receive(:current_user).and_return(mock("user"))
hakanensari
Thanks for this. Is it documented anywhere? I just looked up this very thing earlier today and got the `template` answer.
zetetic
Nope, it wasn't if I remember correctly.
hakanensari