mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
* Update factories * Switch to Firefox headless with Selenium * Fix shoulda setup
16 lines
504 B
Ruby
16 lines
504 B
Ruby
require "spec_helper"
|
|
|
|
describe Category, type: :model do
|
|
it { is_expected.to have_and_belong_to_many(:photos) }
|
|
it { is_expected.to validate_presence_of(:name) }
|
|
it { is_expected.to validate_presence_of(:slug) }
|
|
it { is_expected.to validate_uniqueness_of(:name) }
|
|
it { is_expected.to validate_uniqueness_of(:slug) }
|
|
|
|
let(:category) { create(:category, name: "A Test Category") }
|
|
|
|
it "should have a slug generated from name" do
|
|
expect(category.slug).to eql("a-test-category")
|
|
end
|
|
end
|