-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Create factory_bot traits #310
Comments
@maebeale I can take a look at this. I've worked with Factory Bot before, never with traits, though. Can't be that much of a lift (hopefully) :). |
Awesome and thank you, @leosoaivan ! If it's helpful, here's something I've used in another project:
|
I'll get setup with the project today. Let you know if I have any issues getting setup! |
Any and all feedback welcome on the README, CONTRIBUTING, and background.md docs as you get set up, @leosoaivan ! :) |
It appears I can't get
Have I got the wrong port, perhaps? |
@leosoaivan hey there! hmmm. i don't use the docker rendition, but someone just submitted a PR that changed that from |
@maebeale just a quick update. Haven't been able to get it running locally either with docker-compose start or up. Nevertheless, it might be moot, since I'm mostly focusing on the test suite for now. Now that everything is green, I'll be able to take a closer look at those traits in the coming days! |
Thanks for the update, @leosoaivan ! Did you try the non-docker implementation? Someone else is testing the docker setup, so hopefully that'll get resolved in the next day or so. Great news about the traits! Thank you! |
@leosoaivan hello there! are you still planning to work on this? |
Thanks, @leosoaivan ! I took a hiatus on this one too. :) Ok, I'll remove you here, but would love it if we could help you get things working again -- if you want to get involved again, that is! You're in slack, right? Maybe post something there? We're having a hack night tomorrow, so there will be some help available 7pm-9pm EST. https://www.meetup.com/Code-for-Good-DC/events/268436980/ |
I can work on setting up traits for boxes! |
We have need for varied
user
,box_request
,box
, andbox_item
factory traits (We have existing factories) for use in tests, and later to create seed data.If we had
box
traits that mimic the methods in the box model such asdesign_claimed
,design_completed
,shipping_claimed
,shipping_completed
where the relevant*_by_id
,*_at
, andaasm_state
were populated, that'd be amazing. Foruser
, we need a trait for each constant in the Permission model.This would allow us to skip all the cajoling we had to do in
box_spec.rb
.Instead, it'd be so awesome to be able to call something like:
designer = create(:designer)
bc there was already a traitdesigner
on user who had an associatedcreate(:user_permission, name: Permission::BOX_DESIGNER)
assembled_box = create(:box, :is_assembled)
, which also has/mimics the traits :is_designed, :is_researched, box_request#is_reviewed, etc, bc our/box_requests
index needs all the prior lifecycle phase to be true and all future lifecycle phases to be untrue to display correctly.box_item_with_research_needed = create(:box_item_research_needed)
that is a trait on box_item that who has an associatedcreate(:inventory_type, research_needed: true)
You might want to check out:
box_rb
aasm
blocks in thebox_request
andbox.rb
modelsbox_requests/index.html.erb
orlocalhost:3000/box_requests
in your local browserdatabase-diagram.png
, linked from READMEspec/models/box_spec.rb
to see how we can manually walk box_requests along in the process.The text was updated successfully, but these errors were encountered: