The title is self explanatory.
Everything I\'ve tried led to a \"undefined method\".
To clarify, I am not trying to test a helper method. I am trying to use a he
For anyone coming late to this question, it is answered on the Relish site.
require "spec_helper"
describe "items/search.html.haml" do
before do
controller.singleton_class.class_eval do
protected
def current_user
FactoryGirl.build_stubbed(:merchant)
end
helper_method :current_user
end
end
it "renders the not found message when @items is empty" do
render
expect(
rendered
).to match("Sorry, we can't find any items matching "".")
end
end