Cucumber not finding a route in test mode that I can see in development mode
In development mode, I can point my browser at http://localhost:3000/brands/
and I see a list of all brands, indicating that the route mapping, the index action in the c开发者_运维问答ontroller and the index.html.haml
file are all doing their job.
I have remembered to run rake db:test:clone
.
In /features/support/paths.rb
I have:
def path_to(page_name)
case page_name
when /the home\s?page/
'/'
when /the Brand\s?page/
'/brands'
end
But when I run cucumber features
, I get:
When I am on the Brand page # features/step_definitions/web_steps.rb:44
No route matches "/brands" (ActionController::RoutingError)
How would you go about finding the cause of this problem?
Thanks,
Steven.
Use rails URL helper:
when /the Brand\s?page/
brands_path
精彩评论