Skip to content

Instantly share code, notes, and snippets.

@mistyrinth
Created July 20, 2019 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mistyrinth/0932e1016386dc693e9efca778d2269f to your computer and use it in GitHub Desktop.
Save mistyrinth/0932e1016386dc693e9efca778d2269f to your computer and use it in GitHub Desktop.
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