开发者

How to stub/mock a helper method for functional test in Rails 2.3?

开发者 https://www.devze.com 2022-12-26 17:01 出处:网络
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

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

精彩评论

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