Created
July 20, 2019 09:17
-
-
Save mistyrinth/0932e1016386dc693e9efca778d2269f 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
require 'rails_helper' | |
RSpec.describe Blog, type: :model do | |
it "is valid with name" do | |
@blog = Blog.new(name: "BLOGNAME") | |
expect(@blog).to be_valid | |
end | |
it "raise a validation error" do | |
@blog = Blog.new | |
@blog.valid? | |
expect(@blog.errors.messages[:name]).to include("can't be blank") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment