Inside ./features/support/paths.rb I want to use a
ActionController::Resources helper for Products as mapped in routes.rb
./routes.rb
map.resource :product
./features/support/paths.rb (abbreviated for clarity)
def path_to(page_name)
case page_name
when /Product (\d+)/
project_path(:id => $1)
else
raise “Can’t find mapping from “#{page_name}” to a path.”
end
end
./features/support/paths.rb (abbreviated for clarity)
Given I go to Product 1 page # features/step_definitions/
webrat_steps.rb:6
undefined method `project_path’ for
#ActionController::Integration::Session:0xb6eec0d0 (NoMethodError)
So, can someone tell me the horribly obvious that I’ve missed?
./features/support/paths.rb (abbreviated for clarity)
Given I go to Product 1 page #
features/step_definitions/webrat_steps.rb:6
undefined method `project_path’ for
#ActionController::Integration::Session:0xb6eec0d0 (NoMethodError)
So, can someone tell me the horribly obvious that I’ve missed?