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
|
2024-12-01 18:17:07 +01:00
|
|
|
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
|