Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
AO3-5338 Work factories should create posted works by default #3602
https://otwarchive.atlassian.net/browse/AO3-5338 (please fill in issue number and remove this comment)
This changes the default output of the works factory to create posted works by default, rather than defaulting to drafts.
Existing tests work, factory unchanged except for default.
Thanks for letting me learn on your project. I've dug into this more, and I see where I need to replace the FactoryGirl calls to :posted_work with :work. But I see another potential problem, as there are a number of existing tests that call :work, with the old default behavior of creating draft works.
Do these existing tests need to be altered to explicitly call :draft_work? If you're expecting certain tests to produce a draft there's a problem.
Thanks for taking this on!
Most of the existing tests that call
Some of them are already using the draft factory:
and some explicitly set posted to false (can be changed to
There's no way to tell for sure if we're always using the draft factory where the tests expect drafts, but we can check to some extent by text-searching for "draft" and "unposted" in the spec/ and features/ directories. For example, I see this test which needs to be updated to use drafts: