You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is currently no suggested Practice on how to setup associations and there data using Cypress on Rails and FactoryBot. I have started documenting on ways you can get this right in #100. Currently in our team we tend to lean towards using transient attributes.
FactoryBot.definedofactory:authordoname{'Taylor'}endfactory:postdotransientdoauthor_name{'Taylor'}endtitle{'Cypress on Rails is Awesome'}author{create(:author,name: author_name)}endend
then in Cypress
// example with overriding the defaultscy.appFactories([['create','post',{title: 'Cypress is cool',author_name: 'James'}]]// example without overridingcy.appFactories([['create','post']]
Does anyone else have ways they get associated data setup correctly when using cypress-on-rails?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
There is currently no suggested Practice on how to setup associations and there data using Cypress on Rails and FactoryBot.
I have started documenting on ways you can get this right in #100.
Currently in our team we tend to lean towards using
transientattributes.then in Cypress
Does anyone else have ways they get associated data setup correctly when using cypress-on-rails?
Beta Was this translation helpful? Give feedback.
All reactions