Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 607823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:23:59+00:00 2026-05-13T17:23:59+00:00

Ok, total Cucumber newbie here so please be gentle. As a learning Ruby/Cucumber/MongoDB endeavor

  • 0

Ok, total Cucumber newbie here so please be gentle. As a learning Ruby/Cucumber/MongoDB endeavor I’m building a simple contact manager. I have a Person (parent) model and an have been able to write a simple test as follows:

Scenario: Show people
  Given the following person exists
 | firstname | lastname |
 | Bob      | Jones    |
  When I am on the home page
  Then I should see "Bob"

So far so good….however now I am adding an array of “Address” child objects to it…problem is now that above test fails….I ‘think’ it’s because I’m not describing my table correctly anymore in the above test, since it now has an address property too.

My question is how do I correctly write the above test if I want to check the child objects?

My two classes follow:

class Person < MongoBase
  key :firstname, String, :required=>true
  key :lastname, String, :required=>true

  many :addresses
end

class Address <MongoBase

  key :person_id, ObjectId
  key :street, String
  key :city, String
  key :State, String
  key :Zip, String

  belongs_to :person
end

Thanks in advance!

Update: the original test now passes but I still can’t figure out how to set up the test so that Bob Jones has a child address.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:23:59+00:00Added an answer on May 13, 2026 at 5:23 pm

    I think the $1,000,000 is “what’s the failure”? Also – if you’re using MongoMapper than you’ll want to explicitly set Address as an EmbeddedDocument (include MongoMapper::EmbeddedDocument) – this is most likely what your failure is since (I don’t think) you can use many:XXX with a regular MongoMapper::Document.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

total newbie here. i was trying to replace a character in char * but
I'm a total beginner in C programming so please bear with me. I have
Total noob here. Just installed eclipse and SDK. I was instructed to To update
A total newbie question.... I am developing a Joomla template and in this I
Disclaimer: I'm a total newbie at graph theory and I'm not sure if this
I have total 3 activities. First activity(A) starts second activity(B). From Activity B, 3rd
Total F# n00b question. How do I sort a LIST data structure? Edit: Sorry,
Total row-count is in the range 10k-100k rows. Can I use RAND() on force.com?
I am at a total loss for words. I allow an admin to reset
I am a total novice in DB2. I am trying to help someone else

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.