How to stub/mock a helper method for functional test in Rails 2.3?
I'm wondering how to stub/mock a helper method in functional tests? Thanks!
(And Yes, I already googled & used the search - but couldn't find any workin开发者_运维问答g solution, strange!?)
Have you read the Mocha documentation, specifically the returns
method? You can tell Mocha what the mocked version of your method should send back, letting you set up both good and bad results, depending on what you're trying to test.
精彩评论