rubyforgood / voices-of-consent

Open source tracking and inventory management application for nonprofit, Voices of Consent (Ruby for Good 2019)
https://voices-of-consent.herokuapp.com
MIT License
38 stars 82 forks source link

Create box_request and box seed data from factories #311

Open maebeale opened 4 years ago

maebeale commented 4 years ago

Depends on #310

Using the factories, we'd like to create seeds to create ~30-50 box_requests (and boxes) with the to represent all parts of the box_request/box lifecycle. Here's a SO re referencing factories in seeds (https://stackoverflow.com/questions/5382295/how-can-i-use-factory-girl-in-db-seeds).

We'd like ~30-50 box_requests with random/different box_request_abuse_types that are calling list of traits, e.g. :designed_box, :review_completed, :design_claimed and additional traits like :research_needed (Note that abuse_type seeds were generated by the dev:setup command which called the dev seed data rake task.)

Reviewing a box creates some associated box_items, but we'd want to reference the trait intentionally so some boxes have at least one item that have "research required" and some that have none. That way when we walk the box through the lifecycle (requested, designed, researched, assembled, shipped, followed_up), we'll have some that skip the research step and some that don't.

zachhweed commented 4 years ago

I'll pick this up following the PR on #310