Created
July 3, 2018 07:49
-
-
Save groony/d6513c10805554842184fa0fbf401e60 to your computer and use it in GitHub Desktop.
build_stubbed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bad | |
describe User, type: :model do | |
it do | |
expect(create(:user)).to be_valid | |
end | |
end | |
# Good | |
describe User, type: :model do | |
it do | |
expect(build_stubbed(:user)).to be_valid | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment