-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check model validity #119
Comments
It is very reasonable to use This, however, doesn't work in certain situations, still, workarounds exist.
factory :user do
role { nil } # this makes the model invalid
factory :admin do
role { :admin } # valid now
end
end Solution: exclude
Bottom line: would you like to amend the current recommendation, shifting it towards |
Ad. 1
Ad. 2 Ad. 3 // So I see that you have fast specs beside validations 👍 Ad. Bottom line |
Content below exists in guide from the initial version
I would not add additional code to spec factory validity if factory bot is delivering that one (also with traits: true)
see: https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#linting-factories
The text was updated successfully, but these errors were encountered: