-
Notifications
You must be signed in to change notification settings - Fork 4
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
T557 seeding dev data #563
Conversation
…orks, add 'authenticated' visibility option to factory
Are you able to edit one of the seeded works in the UI? I tried editing one and I get the following error:
Which I believe is what I was seeing before, when trying to write a spec test for editing a work. |
I think I fixed the issue by associating a permission template with the admin set that holds the works. I was trying to follow the logic here. |
Just made a few more changes to this to incorporate ETDs, Journal Issues, and adding works to a collection, so I think it should be all set for testing once CI process finishes. @maxturer - Particularly would be interested in if there's anything else that would be beneficial to include from like a front-end styling standpoint. This should have a few collections, a few works within a collection, public works with metadata, but happy to add anything else to this that you think would be helpful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is more than enough! I can log in as the seeded users and the fine Professor Goodtests has submitted plenty of work for front end development.
@maxturer - Cool, thanks for taking a look! There's a way to use like the "attach-files-to-work-job" (I forget the exact syntax) to actually attach files to works in seeding, but it ends up taking significantly longer as the files are processed. If you're working on something where it'd be significantly beneficial to have that, lemme know and I'll show you how to manually add that step to the |
Absolutely also cool with leaving that out, I think we've solved enough front end issues with the file list that we won't need to look at it for a while. |
Will close #557
This PR:
factory
files from the Hyrax repository for use in testing and seeding of development data.fixture
files from the Hyrax repository that are used in seeding works.seeds.rb
file to:production
, should only be used fordevelopment
. Use theprep_new_prod
rake task if you need to set up a new production environment, which does not seed with demo works.password
).GwWorks
with metadata filled in, should be viewable without logging in, and adds them toCollection Title 1
.GwJournalIssues
GwEtds
There might (probably) be a cleaner way of importing the factories and fixtures from Hyrax, but the location of these files in their repository has changed recently, and we are on a different version than their most up-to-date - so simplest/most stable solution right now was to just directly copy from their repository and make tweaks where needed. Definitely open to feedback or other ideas for handling this.
To test:
rails db:drop
followed byrails db:create
followed byrails db:migrate
).rails db:seed
, which may take 2-3 minutes to run. Ensure there are no errors.rails s
and ensure that the created works are visible, and you are able to log in as any of the users created in the seeds file.