wedding-planner/spec/models/wedding_spec.rb

23 lines
752 B
Ruby
Raw Permalink Normal View History

2024-11-30 18:31:48 +00:00
# Copyright (C) 2024 Manuel Bustillo
2024-11-30 19:24:59 +01:00
require 'rails_helper'
RSpec.describe Wedding, type: :model do
describe 'validations' do
subject { build(:wedding) }
describe 'slug' do
it { should allow_value('foo').for(:slug) }
it { should allow_value('foo-bar').for(:slug) }
it { should allow_value('foo-123').for(:slug) }
it { should allow_value('foo-123-').for(:slug) }
it { should allow_value('foo--123').for(:slug) }
it { should_not allow_value('Foo').for(:slug) }
it { should_not allow_value('/foo').for(:slug) }
it { should_not allow_value('foo/123').for(:slug) }
it { should_not allow_value('foo_123').for(:slug) }
it { should_not allow_value('foo/').for(:slug) }
end
end
2024-11-30 19:24:59 +01:00
end