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
Your factories should create valid objects by default. I found that transient attributes can be used to add conditional logic like this:
transient do
skip_validations false
end
before :create do |instance, evaluator|
instance.save(validate: false) if evaluator.skip_validations
end
In your test:
create(:group, skip_validations: true)