catstodon/spec/models/domain_allow_spec.rb

16 lines
373 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2019-07-30 11:10:46 +02:00
require 'rails_helper'
RSpec.describe DomainAllow do
describe 'Validations' do
it { is_expected.to validate_presence_of(:domain) }
context 'when a normalized domain exists' do
before { Fabricate(:domain_allow, domain: 'にゃん') }
it { is_expected.to_not allow_value('xn--r9j5b5b').for(:domain) }
end
end
2019-07-30 11:10:46 +02:00
end