开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜