wedding-planner/spec/models/wedding_spec.rb
Manuel Bustillo 9d08ef6f18
All checks were successful
Check usage of free licenses / check-licenses (pull_request) Successful in 38s
Add copyright notice / copyright_notice (pull_request) Successful in 1m7s
Run unit tests / unit_tests (pull_request) Successful in 1m34s
Update wedding slug rules to accept numbers and other chars
2024-12-01 18:17:37 +01:00

23 lines
752 B
Ruby

# Copyright (C) 2024 Manuel Bustillo
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
end