Add uniqueness to block email domains (#5692)
This commit is contained in:
committed by
Eugen Rochko
parent
8087aa83d4
commit
20150659e6
@ -13,9 +13,10 @@ RSpec.describe EmailDomainBlock, type: :model do
|
||||
Fabricate(:email_domain_block, domain: 'example.com')
|
||||
expect(EmailDomainBlock.block?('nyarn@example.com')).to eq true
|
||||
end
|
||||
|
||||
it 'returns true if the domain is not registed' do
|
||||
Fabricate(:email_domain_block, domain: 'domain')
|
||||
expect(EmailDomainBlock.block?('example')).to eq false
|
||||
Fabricate(:email_domain_block, domain: 'example.com')
|
||||
expect(EmailDomainBlock.block?('nyarn@example.net')).to eq false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user