Factory-girl create that bypasses my model validation

后端 未结 9 2166
既然无缘
既然无缘 2021-01-30 06:31

I am using Factory Girl to create two instances in my model/unit test for a Group. I am testing the model to check that a call to .current returns only the \'current\' groups ac

9条回答
  •  北荒
    北荒 (楼主)
    2021-01-30 06:54

    For this specific date-baesd validation case, you could also use the timecop gem to temporarily alter time to simulate the old record being created in the past.

提交回复
热议问题