require 'rails_helper'

RSpec.describe Link, type: :model do
  context "validity" do
    let(:subject) { Link.new(title: "Example", url: "http://example.com") }

    it "should validate link" do
      expect(subject).to be_valid
    end

    it "should throw a validation error" do
      subject.url = nil
      subject.title = nil

      expect(subject).to be_invalid
    end
  end
end
