0

I am having a really hard time. I am using cucumber tests for visiting a link. I am using the pickle web steps for

When I go to the post comment's new page

It does not seem to be working. I also tried I am on the post comment's new page but that is also not working. The error is stack level too deep. However when I write the custom step of my own the test is passing. It is too tiresome to write the steps for every page. Is anyone else getting a similar problem?

Sadiksha Gautam
  • 5,032
  • 6
  • 40
  • 71

2 Answers2

2

I've seen the exact same error but managed to get rid of it by replacing the following auto-generated pickle path helper in features/step_definitions/paths.rb

when /^#{capture_model}(?:'s)? (.+?) page$/
  path_to_pickle $1, :extra => $2

with my own:

when /^#{capture_model}(?:'s)? (.+?) page$/
  polymorphic_path(model($1), :action => $2)
  • okay... but what I wanted to do is use the steps of pickle itself. Is there any way I won't have to write my custom steps? If i replace path_to_pickle with polymorphic_path will there be any problem? and what about nested routes? – Sadiksha Gautam Apr 07 '11 at 03:28
  • How to write polymorphic_path for "post's comment's new page". I tried "polymorphic_path(model($1, $2), :action => $3)", but there was "wrong number of arguments" error. Also comment is new it will give "undefined method `model_name' for NilClass:Class" error. – Sadiksha Gautam Apr 07 '11 at 09:51
  • Something like `polymorphic_path(model!($1), model!($2), :action => $3)` should work. I'd use the bang model method to make sure the model exists to avoid passing invalid arguments to `polymorphic_path`. – James Conroy-Finn Sep 02 '11 at 16:11
2

I simply replaced:

path_to_pickle $1, :extra => $2

With:

path_to_pickle $1, :action => $2
Shanon M
  • 21
  • 1