Improve workshop factories - #16481
Conversation
|
Some tests may break with this. I'm waiting for the circle run to complete, then will fix them |
There was a problem hiding this comment.
Should we sequence name here too for parity with facilitator?
There was a problem hiding this comment.
I think this part better belongs in the pd_teachercon_survey factory, with a trait or transient attribute something for facilitators.
There was a problem hiding this comment.
Sure - I can move it there and make it an after_create. We just need the facilitators from it
There was a problem hiding this comment.
Having second thoughts on moving this.
For testing purposes, I'm usually going to be saying "Give me a workshop with a bunch of enrollments and survey responses associated with those enrollments." With the current setup, that's one line with this statement. With what you're proposing, it would instead be
create the workshop
create the enrollments
create the surveys that use workshop data to fill out their contents
I'm not really sure if that's better.
If this isn't a big deal, I'd like to punt on this for the time being because of the time pressure. I'm also anxious about a change that will make me have to rewrite a lot of the existing survey tests - the main motivation for this change is to make it easier for me to make sample data on my localhost
There was a problem hiding this comment.
I think you misunderstood my suggestion. I'm talking about encapsulation. The workflow here will remain the same.
This whole section from line 63 - 79 is creating a pd_teachercon_survey based on a set of facilitators. Logically that belongs in the pd_teachercon_survey factory so it can be used on its own. As a new trait or transient attribute that shouldn't affect other tests. Then this section, inside pd_workshop factory can simply call create :pd_teachercon_survey and pass in the list of facilitators.
There was a problem hiding this comment.
Will fix the error
e0ca6e1 to
a05b50e
Compare
We now have simpler factories for creating local workshops with survey responses, as well as teachercon workshops with survey responses.