views:

166

answers:

1

Hey there!

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 working solution, strange!?)

A: 

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.

jdl
well the problem is not the return value, it's more the case how to 'find' the method to [email protected](:my_helper_method).returns('stubed value') doesn't work...
RngTng