2024-12-28 16:31:27 +00:00
|
|
|
# Copyright (C) 2024 Manuel Bustillo
|
|
|
|
|
2024-12-28 17:27:28 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-11-30 18:31:48 +00:00
|
|
|
# Copyright (C) 2024 Manuel Bustillo
|
|
|
|
|
2024-11-30 19:24:59 +01:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2024-12-28 17:27:28 +01:00
|
|
|
RSpec.describe Wedding do
|
2024-12-01 18:17:07 +01:00
|
|
|
describe 'validations' do
|
|
|
|
subject { build(:wedding) }
|
2024-12-28 17:27:28 +01:00
|
|
|
|
2024-12-01 18:17:07 +01:00
|
|
|
describe 'slug' do
|
2024-12-28 17:27:28 +01:00
|
|
|
it { is_expected.to allow_value('foo').for(:slug) }
|
|
|
|
it { is_expected.to allow_value('foo-bar').for(:slug) }
|
|
|
|
it { is_expected.to allow_value('foo-123').for(:slug) }
|
|
|
|
it { is_expected.to allow_value('foo-123-').for(:slug) }
|
|
|
|
it { is_expected.to allow_value('foo--123').for(:slug) }
|
2024-12-01 18:17:07 +01:00
|
|
|
|
2024-12-28 17:27:28 +01:00
|
|
|
it { is_expected.not_to allow_value('Foo').for(:slug) }
|
|
|
|
it { is_expected.not_to allow_value('/foo').for(:slug) }
|
|
|
|
it { is_expected.not_to allow_value('foo/123').for(:slug) }
|
|
|
|
it { is_expected.not_to allow_value('foo_123').for(:slug) }
|
|
|
|
it { is_expected.not_to allow_value('foo/').for(:slug) }
|
2024-12-01 18:17:07 +01:00
|
|
|
end
|
|
|
|
end
|
2024-11-30 19:24:59 +01:00
|
|
|
end
|