application_helper.rbに簡単なヘルパーメソッドがありますが、これをテストしようとしていますが、仕様が失敗している理由を一生理解することはできません。以下のコードを含めました。スペックは期待される""を出力し、nilを取得し、正気度はrespond_to?プリント番号を確認してください。私は何が欠けていますか?
require 'spec_helper'
describe ApplicationHelper do
describe "#tagline" do
specify { helper.tagline('text').should == '<div class="tagline"><p>text</p></div>' }
p helper.respond_to?(:tagline) ? "yes" : "no"
end
end
------
module ApplicationHelper
def tagline(text)
content_for(:tagline) { %Q(<div class="tagline"><p>#{text}</p></div>).html_safe }
end
end