Bambinos RSS

New Bamboo

Bamboo Blog

Archive

Aug
22nd
Fri
permalink bartoszblimke

How to mock Rails view helpers with RSpec

If you want to stub view helper method in some view spec, you can do the following:

 @controller.template.stub!(:helper_method_name).with(:some_args).and_return("some result")