0
私はapplication_helper.rbに簡単なヘルパーメソッドを持っています。これは私がテストしようとしているもので、なぜ私の仕様が失敗したのか理解できません。私は以下のコードを含んでいます。 specは期待される ""を得て、そして健全性はrespond_toを出力します。チェックプリント番号。私は何が欠けていますか?Rspec testing application_helper.rb
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