I am trying to test the html block method inside the rails helper:
def dashboard_widget(header, &proc)
concat('<div class="dashboard-widget">')
etc
end
The code works perfectly in the development environment, but the following test is failed:
it "should be created" do
helper.dashboard_widget('My widget') do
"hello world"
end.should be_true
end
With the following stacktrace:
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'
Please, suggest what am I doing wrong?
Thanks.