3
我試圖測試軌道助手裏面的HTML塊的方法:output_buffer是幫手規格空
def dashboard_widget(header, &proc)
concat('<div class="dashboard-widget">')
etc
end
代碼工作完全在開發環境中,但下面的測試失敗:
it "should be created" do
helper.dashboard_widget('My widget') do
"hello world"
end.should be_true
end
用下面的堆棧跟蹤:
d:/s/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_view/helpers/text_helper.rb:32:in `concat'
D:/makabu/medved/winvest/master/app/helpers/dashboards_helper.rb:6:in `dashboard_widget'
./spec\helpers\dashboards_helper_spec.rb:13:
d:/s/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.8/lib/spec/example/example_methods.rb:40:in `instance_eva
l'
d:/s/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.8/lib/spec/example/example_methods.rb:40:in `execute'
請,建議我究竟做錯了什麼?
謝謝。