Skip to content

Commit

Permalink
Use build instead of create in validate_uniqueness
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlouden authored and mcmire committed Oct 30, 2020
1 parent ffd5a28 commit 4ecc9d2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module ActiveRecord
#
# RSpec.describe Post, type: :model do
# describe "validations" do
# subject { Post.create(content: "Here is the content") }
# subject { Post.new(content: "Here is the content") }
# it { should validate_uniqueness_of(:title) }
# end
# end
Expand All @@ -92,7 +92,7 @@ module ActiveRecord
#
# RSpec.describe Post, type: :model do
# describe "validations" do
# subject { FactoryBot.create(:post) }
# subject { FactoryBot.build(:post) }
# it { should validate_uniqueness_of(:title) }
# end
# end
Expand Down

0 comments on commit 4ecc9d2

Please sign in to comment.