Helper render_breadcrumbs okay in dev env but not found by cucumber
I am using breadcrumbs_on_rails v1.0.1 in a Rails 2.3.10 app by including the gem in my Gemfi开发者_Python百科le. In my development environment I see no problems at all - the views render as expected. In my cucumber tests though, I get the following:
undefined local variable or method `render_breadcrumbs' for #<ActionView::Base:0x1034c46f0> (ActionView::TemplateError)
1: = render_breadcrumbs
I've also tried to use
config.gem "breadcrumbs_on_rails"
in my config/environment.rb
instead of including the gem in my Gemfile. I've also tried explicitly including BreadcrumbsOnRails
in my spec_helper.rb
without luck.
Confused as to why the render_breadcrumbs
helper is found in the dev environment but not in test.
I'm not sure why it would be working in development and not in cucumber, but render_breadcrumbs
is provided by BreadcrumbsOnRails::ControllerMixin
.
The breadcrumbs_on_rails README suggests including that mixin in ApplicationController, though it suggests this specifically for Rails 3 compatibility. It's still worth a try if nothing else is working.
精彩评论