Hi all, I''m missing something basic here. 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 rake features 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? Peter Fitzgibbons (847) 687-7646 Email: peter.fitzgibbons at gmail.com IM GTalk: peter.fitzgibbons IM Yahoo: pjfitzgibbons IM MSN: pjfitzgibbons at hotmail.com IM AOL: peter.fitzgibbons at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090130/a9888f34/attachment.html>
Hi, uhmmm ''project''.should be(''product'') Am 30.01.2009 um 15:10 schrieb Peter Fitzgibbons:> Hi all, > > I''m missing something basic here. > > 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 > > rake features > 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?-- Thomas R. "TomK32" Koll <> http://ananasblau.com just a geek trying to change the world http://github.com/TomK32
On Fri, Jan 30, 2009 at 8:10 AM, Peter Fitzgibbons <peter.fitzgibbons at gmail.com> wrote:> Hi all, > > I''m missing something basic here. > > 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 > > rake features > 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?map.resource :product project_path(:id => $1) product != project> > Peter Fitzgibbons > (847) 687-7646 > Email: peter.fitzgibbons at gmail.com > IM GTalk: peter.fitzgibbons > IM Yahoo: pjfitzgibbons > IM MSN: pjfitzgibbons at hotmail.com > IM AOL: peter.fitzgibbons at gmail.com > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
See, I told you it was horribly obvious! *blush* Thanks Thomas, David. Peter Fitzgibbons (847) 687-7646 Email: peter.fitzgibbons at gmail.com IM GTalk: peter.fitzgibbons IM Yahoo: pjfitzgibbons IM MSN: pjfitzgibbons at hotmail.com IM AOL: peter.fitzgibbons at gmail.com On Fri, Jan 30, 2009 at 8:26 AM, David Chelimsky <dchelimsky at gmail.com>wrote:> On Fri, Jan 30, 2009 at 8:10 AM, Peter Fitzgibbons > <peter.fitzgibbons at gmail.com> wrote: > > Hi all, > > > > I''m missing something basic here. > > > > 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 > > > > rake features > > 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? > > map.resource :product > project_path(:id => $1) > > product != project > > > > > Peter Fitzgibbons > > (847) 687-7646 > > Email: peter.fitzgibbons at gmail.com > > IM GTalk: peter.fitzgibbons > > IM Yahoo: pjfitzgibbons > > IM MSN: pjfitzgibbons at hotmail.com > > IM AOL: peter.fitzgibbons at gmail.com > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090130/f80f3d9f/attachment.html>