I’ve got the view helper method in my application helper:
module ApplicationHelper
def formatted_something(something)
"Hello, #{something}"
end
end
I want to access that method in my request spec:
require "spec_helper"
describe "something" do
include RequestSpecHelper
it "should display blogs list" do
visit something_url
page.should have_content formatted_something(@something.something)
end
end
It couldn’t find formatted_something method.
You just need to include the relevant helper module in your
describeblock, and it will be available in all nested specs: