factory-lady
factory-lady copied to clipboard
Testing Default Values
I'm trying to test the default values on some Mongoose models. The test I'm using was basically making the object without the property in question and then testing if that value is added. However, this pattern does not seem to work with Factory Lady.
Is there a specific way to test defaults with Factory Lady? I already tried passing in { property_name: undefined } to Factory.build, to no avail.
Any reason for not doing new Something?
I have required fields, which means that with new Something I would have to basically copy the valid attributes object again sans a single line, which gets quite cumbersome.