Pickle and its paths

3 views
Skip to first unread message

Stephan

unread,
Feb 7, 2010, 6:55:26 PM2/7/10
to pickle
Hi,

using pickle 0.2.1, I have trouble using its path methods. I have
models called "dancer" and "performance" and I have several cucumber
features in which I use pickle to access factories and create models.
However, when I try to use one of the routes to figure out a path,
something goes wrong:

When I go to the dancers
page
# test/integration/step_definitions/web_steps.rb:22
undefined method `new_performance_path' for class
`ActionController::Integration::Session' (NameError)
./test/integration/support/paths.rb:38:in `send'
./test/integration/support/paths.rb:38:in `path_to'
./test/integration/step_definitions/web_steps.rb:23:in `/^(?:|
I )go to (.+)$/'
test/integration/features/admin/admin.feature:8:in `When I go to
the dancers page'

I checked... "new_performance" is available as a route.

Anyone got any ideas? What more info can I provide?

Thx
Stephan

schlick

unread,
Feb 10, 2010, 8:57:59 AM2/10/10
to pickle
Hi Stephan,

All I can think of is:
1) check your routes using rake routes and checking there is one for
new_performance (are they nested BTW?)
2) check that the models exist
3) check that the controllers exist

What is the relationship between dancer and performance and is there
any fancy stuff going on?

Cheers,

Michael.

Stephan

unread,
Feb 10, 2010, 1:03:54 PM2/10/10
to pickle
Hey Michael,

thanks for your comment. It led me to recognize what my problem was: I
am using Translator (http://github.com/graysky/translator) to create
internationalized paths. Because I had problems with translator and
routes in my other tests I had included the Translator routes line as
such:

unless RAILS_ENV == 'test'
ActionController::Routing::Translator.translate_from_file 'config/
locales', 'i18n-routes.yml'
end

What I didn't realize up until now is that this doesn't cover cucumber
tests, as they run in their own environment...
I still would like to have Translator working in my tests, but I can
now say, that it is definetly not a pickle/cucumber issue.

Stephan

Stephan

unread,
Feb 10, 2010, 1:22:19 PM2/10/10
to pickle
Hey Michael,

thanks for your comment. It led me to recognize what my problem was: I
am using Translator (http://github.com/graysky/translator) to create
internationalized paths. Because I had problems with translator and
routes in my other tests I had included the Translator routes line as
such:

unless RAILS_ENV == 'test'
ActionController::Routing::Translator.translate_from_file 'config/
locales', 'i18n-routes.yml'
end

What I didn't realize up until now is that this doesn't cover cucumber
tests, as they run in their own environment...
I still would like to have Translator working in my tests, but I can
now say, that it is definetly not a pickle/cucumber issue.

Stephan

On Feb 10, 2:57 pm, schlick <mich...@starclass.com.au> wrote:

Stephan

unread,
Feb 10, 2010, 1:23:20 PM2/10/10
to pickle
Here is what I did to get pickle and translator play together...

http://github.com/graysky/translator/issues#issue/12

Stephan

Reply all
Reply to author
Forward
0 new messages