require 'rails_helper'

RSpec.describe Category, type: :model do
  let(:name) {"Sample Topic"}
  let(:description) {"Sample Topic Description"}
  let(:topic) { Category.create!(name: name, description: description)}

  it {is_expected.to have_many(:photos)}

  it {is_expected.to validate_presence_of(:name)}

  describe "attributes" do
    it "has name and description attributes" do
      expect(topic).to have_attributes(name: name, description: description)
    end
  end
end
