Simplify basic presence validations (#29664)
This commit is contained in:
parent
bc435c63bd
commit
5acec087ca
16 changed files with 28 additions and 159 deletions
|
@ -4,11 +4,7 @@ require 'rails_helper'
|
|||
|
||||
RSpec.describe DomainAllow do
|
||||
describe 'Validations' do
|
||||
it 'is invalid without a domain' do
|
||||
domain_allow = Fabricate.build(:domain_allow, domain: nil)
|
||||
domain_allow.valid?
|
||||
expect(domain_allow).to model_have_error_on_field(:domain)
|
||||
end
|
||||
it { is_expected.to validate_presence_of(:domain) }
|
||||
|
||||
it 'is invalid if the same normalized domain already exists' do
|
||||
_domain_allow = Fabricate(:domain_allow, domain: 'にゃん')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue