Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turns out we do want factories! #837

Closed
jmartin-sul opened this issue Jun 7, 2018 · 3 comments
Closed

turns out we do want factories! #837

jmartin-sul opened this issue Jun 7, 2018 · 3 comments

Comments

@jmartin-sul
Copy link
Member

early on i'd opened a ticket and created a branch about adding FactoryGirl FactoryBot to the project, but we closed it, because i didn't actually see the benefit at the time (seemed easy enough to use seeded fixtures, or create objects using ActiveRecord calls in let statements).

@atz has made a convincing case for how factories would simplify the creation of our test fixtures, especially since many of our test cases are just testing the ActiveRecord objects and their database interactions, and not the content of the fixture objects on disk. there are still cases where we care about using real fixture objects on disk, and for those, we don't want to use factories.

for everything else, to the degree that it's tractable in the time we have, we want to switch over to using factories instead of the more manual process of ActiveRecord create and find_by calls.

@atz
Copy link
Contributor

atz commented Aug 2, 2018

This is somewhat accomplished now. Dunno how much we need a ticket for it anymore.

@atz
Copy link
Contributor

atz commented Aug 8, 2018

In #1062, I made a fixture-aware factory, so I think we could use factories in all cases.

@atz
Copy link
Contributor

atz commented Oct 16, 2018

We have a robust set of factories now. I'm closing this as having ambiguous scope.

I'd support a separate ticket for "Replace DB seeding w/ factories", since that is the really the only remaining pocket of anti-pattern in the test setup. Seeding currently installs 2 kinds of objects: MoabStorageRoot and ZipEndpoint (with PreservationPolicy.default_policy, indirectly). Most of the entanglements are in the overwrought POH specs.

@atz atz closed this as completed Oct 16, 2018
@atz atz removed the backlog label Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants