I'm writing a view spec, and it renders a view that contains the line (in haml):
=link_to new_post_path
but the spec fails with:
ActionController::RoutingError: No route matches {:action=>"new", :controller=>"post"}
I'm trying to stub the new_post_path
method, as it's not actually important to the view spec, but haven't had any luck.
I've tried, within my spec, the following two variations without any luck:
stub!(:new_post_path).and_return("this path isn't important")
controller.stub!(:new_post_path).and_return("this path isn't important")