pickle_steps not matching

59 views
Skip to first unread message

R Law

unread,
Feb 23, 2011, 8:48:10 AM2/23/11
to pickle
I recently upgraded cucumber-rails from 0.3.2 to 0.4.0.beta.1 and
suddenly my pickle step definitions aren't working. I've re-run both
generators but this step:

And an article_submission exists with title: "Testing Web Apps"

Isn't matched by:

# create a model
Given(/^#{capture_model} exists?(?: with #{capture_fields})?$/) do |
name, fields|
create_model(name, fields)
end

My pickle_steps.rb is unchanged. All other steps are passing normally.
I've tried the examples in the README such as:

Given a user exists

And I get these errors:

You can implement step definitions for undefined steps with these
snippets:

Given /^a user exists$/ do
pending # express the regexp above with the code you wish you had
end

Given /^an article_submission exists with title: "([^"]*)"$/ do |arg1|
pending # express the regexp above with the code you wish you had
end

Ian White

unread,
Feb 23, 2011, 3:16:18 PM2/23/11
to pickle-...@googlegroups.com
Hi Rob,

It looks like your factories etc are now not being loaded before pickle, therefore pickle doesn't know about 'article_submission' and the like.

Try explicitly requiring your blueprints, or factories, or if you aren't using any, the models, at the top of features/support/pickle.rb

Let me know how you get on,

Cheers,
Ian

> --
> You received this message because you are subscribed to the Google Groups "pickle" group.
> To post to this group, send email to pickle-...@googlegroups.com.
> To unsubscribe from this group, send email to pickle-cucumb...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pickle-cucumber?hl=en.
>

R Law

unread,
Feb 28, 2011, 4:16:26 PM2/28/11
to pickle
It looks like it's related to this issue:
https://github.com/thoughtbot/factory_girl/issues#issue/129

am

unread,
Apr 3, 2011, 11:19:45 AM4/3/11
to pickle
Hello Ian, I also have similar situation. Using rails 3.0.5, cucumber-
rails 0.4.0, pickle 0.4.7. Everything installed properly but not so
sure why I'm getting undefined steps. I remember at some point it
worked but today after reinstalling gem and rails on a new machine
this doesn't work anymore. I can still use pickle without mechanics
and factory_girl right? Please give me an example of how to
explicitly requiring at the top of features/support/pickle.rb. I'm not
using any blue print or factories. Thanks so much.


Scenario: Employee found in Nucleus staffing table
Given a employee exists with a :first_name "John"


You can implement step definitions for undefined steps with these
snippets:
Given /^a employee exists with a :first_name "([^"]*)"$/ do |arg1|
pending # express the regexp above with the code you wish you had
end



Ian White

unread,
Apr 3, 2011, 11:31:15 AM4/3/11
to pickle-...@googlegroups.com
Hi

The step def you provide has the colon in the wrong place. It should read:

Given a employee exists with a first_name: "John"

Hope that helps,
Cheers,
Ian

Sent from my iPhone

am

unread,
Apr 3, 2011, 12:05:51 PM4/3/11
to pickle
Ian, You are great. What a silly me.


On Apr 3, 11:31 am, Ian White <ian.w.wh...@gmail.com> wrote:
> Hi
>
> The step def you provide has the colon  in the wrong place. It should read:
>
> Given a employee exists with a first_name:  "John"
>
> Hope that helps,
> Cheers,
> Ian
>
> Sent from my iPhone
>

Ian White

unread,
Apr 3, 2011, 12:42:23 PM4/3/11
to pickle-...@googlegroups.com
:) no probs.
Reply all
Reply to author
Forward
0 new messages