factory-lady icon indicating copy to clipboard operation
factory-lady copied to clipboard

Testing Default Values

Open casey-chow opened this issue 13 years ago • 2 comments

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.

casey-chow avatar Nov 02 '12 16:11 casey-chow

Any reason for not doing new Something?

petejkim avatar Nov 18 '12 20:11 petejkim

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.

casey-chow avatar Nov 18 '12 22:11 casey-chow