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
WIP: Seed photos #712
WIP: Seed photos #712
Conversation
context 'photos' do | ||
before(:each) do | ||
@seed = FactoryGirl.create(:seed) | ||
@photo = FactoryGirl.create(:photo) |
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.
Is it possible to just define the association in the call to create? Something like:
@photo = FactoryGirl.create(:photo, :seed => @seed)
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.
No idea. I'm really in "copy and paste what someone else did, then poke it a little" mode when it comes to the spec files.
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.
It certainly is (and can make things a lot neater with complex graphs of objects), but it might be even better to consider a "seed-with-complete-data" factory that has some smart defaults.
https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md#associations
The build's failing because of a one-character error on line 22 of app/views/photos/show.html.haml - replace |
Oh thanks. Still need to figure out writing feature tests though :-/ |
Let us know if you'd like any help with writing feature tests - we can set up a pairing session or something if you want. |
Yes, please! On Thu, Aug 20, 2015 at 10:48 AM Cesy notifications@github.com wrote:
|
Moving to release 12, because 11 is for bug fixes On one of the photo PRs, Skud mentioned we probably ought to be using concerns rather than having duplicating so much code, so I'm leaning toward doing that refactor as part of this, before I go and commit even more duplicate code to the repo. Which means I should probably close this PR and open a new one with a branch that has DRYer code. |
Fixes #495
This is almost ready. After @sksavant finishes with #679 I'll add seeds to the list in there. Then it'll be ready.