Testing methods called on yielded object
- by Todd R
I have the following controller test case:
def test_showplain
Cleaner.expect(:parse).with(@somecontent)
Cleaner.any_instance.stubs(:plainversion).returns(@returnvalue)
post :showplain, {:content => @somecontent}
end
This works fine, except that I want the "stubs(:plainversion)" to be an "expects(:plainversion)".
Here's the controller…