Giter VIP home page Giter VIP logo

Comments (4)

paulelliott avatar paulelliott commented on July 3, 2024

You should be doing this the other way around. Always build from the top down.

Given the following author:
| name | John Doe |
And that author has 1 book

from fabrication.

knwang avatar knwang commented on July 3, 2024

I don't think authors are "on top of" books in this example - they "have many through" each other. But agree with you that coming from the other direction would solve this problem.

from fabrication.

paulelliott avatar paulelliott commented on July 3, 2024

Oh, you are absolutely right. Sorry about that.

The base fabricator should never build things that aren't necessary to persist the object. You should make a :book_with_author fabricator for when you need them together. This will reduce the "magic" in your test suite and make cucumber work a lot better.

from fabrication.

knwang avatar knwang commented on July 3, 2024

Makes a lot of sense. Thanks!

from fabrication.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.