Created
September 29, 2017 17:16
-
-
Save giovannibenussi/b1016a4b158aed31d304e138eddf8b34 to your computer and use it in GitHub Desktop.
This file contains 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
it "can't be saved without an user" do | |
post = Post.new | |
post.user = nil | |
expect { post.save!(validate: false) }.to raise_error ActiveRecord::NotNullViolation | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment