Uninitialized Constant - Factory_Girl, Mongo_Mapper

38 views
Skip to first unread message

Dave the Ninja

unread,
Aug 7, 2010, 7:08:46 AM8/7/10
to pickle
Hi guys,

I have been going through my code, google and pickle source all day in
relation to using Factory_Girl, Mongo_Mapper and Pickle for testing my
application.

I am currently getting the following error, and it has been the same
one all day no matter what configurations I use:


Feature: Contact us page
In order to send a general enquiry email
As a visitor to the site
I want to be presented with a set of fields to allow me to send an
email to Des

Scenario: Visitor submits the form with valid
details # features/contact_us_view.feature:12
Given I am on "the contact us
page" # features/step_definitions/
web_steps.rb:19
When I enter valid details into the public contact form and press
send # features/step_definitions/application_steps.rb:12
Then a enquiry should
exist # features/
step_definitions/pickle_steps.rb:19
uninitialized constant Enquiry::PickleAdapter (NameError)
./features/step_definitions/pickle_steps.rb:20:in `/^((?:(?:)|(?:
(?:a|an|another|the|that) )?(?:(?:(?:(?:first|last|(?:\d+(?:st|nd|rd|
th))) )?(?:enquiry))|(?:(?:enquiry)(?::? "(?:[^\"]|\.)*"))))) should
exist(?: with ((?:(?:\w+: (?:(?:(?:)|(?:(?:a|an|another|the|that) )?(?:
(?:(?:(?:first|last|(?:\d+(?:st|nd|rd|th))) )?(?:enquiry))|(?:
(?:enquiry)(?::? "(?:[^\"]|\.)*"))))|(?:"(?:[^\"]|\.)*"|nil|true|false|
[+-]?[0-9_]+(?:\.\d+)?))), )*(?:\w+: (?:(?:(?:)|(?:(?:a|an|another|the|
that) )?(?:(?:(?:(?:first|last|(?:\d+(?:st|nd|rd|th))) )?(?:enquiry))|
(?:(?:enquiry)(?::? "(?:[^\"]|\.)*"))))|(?:"(?:[^\"]|\.)*"|nil|true|
false|[+-]?[0-9_]+(?:\.\d+)?)))))?$/'
features/contact_us_view.feature:15:in `Then a enquiry should
exist'


-----------

The Uninitialized Constant error is the thing that I can not track
down. I know pickle can work with Mongo_Mapper and Factory_Girl as a
friend of mine has it working, I also have his code and after
replicating his setup my app still does not play dice.

Any information on where and how this error occurs would be highly
grateful

Cheers

Davie

Ian White

unread,
Aug 10, 2010, 4:21:53 AM8/10/10
to pickle-...@googlegroups.com
Hi there,

Are you using the same version of pickle as your friend who has mongo+pickle working?
The way ORMs are used has changed with pickle 0.3.x, I wonder if this is causing the mongo hax way to fail now.

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.
>

David Lawton

unread,
Aug 10, 2010, 4:25:35 AM8/10/10
to pickle-...@googlegroups.com
*face palm*

I will check the versions tonight and report back.

Sent from my iPhone

Ian White

unread,
Aug 17, 2010, 8:12:32 AM8/17/10
to pickle
Hi David,

How did you get on?

Cheers,
Ian

On Aug 10, 9:25 am, David Lawton <da...@davetheninja.net> wrote:
> *face palm*
>
> I will check the versions tonight and report back.
>
> Sent from my iPhone
>
> >> For more options, visit this group athttp://groups.google.com/group/pickle-cucumber?hl=en.

David Lawton

unread,
Aug 17, 2010, 8:43:52 AM8/17/10
to pickle-...@googlegroups.com
Hey ian.

I forgot to gem install pickle-mongo_mapper :-)

Schoolboy error at its finest

Pickle is working like a treat

Ninja

Sent from my iPhone

Ian White

unread,
Aug 19, 2010, 8:38:10 AM8/19/10
to pickle-...@googlegroups.com
FYI, pickle 0.4.0 (released today) has Mongoid support builtin. MongoMapper adapter welcome!

Cheers,
Ian

Reply all
Reply to author
Forward
0 new messages