The code powering m.abunchtell.com https://m.abunchtell.com
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

23 lignes
677 B

  1. require 'rails_helper'
  2. RSpec.describe EmailDomainBlock, type: :model do
  3. describe 'validations' do
  4. it 'has a valid fabricator' do
  5. email_domain_block = Fabricate.build(:email_domain_block)
  6. expect(email_domain_block).to be_valid
  7. end
  8. end
  9. describe 'block?' do
  10. it 'returns true if the domain is registed' do
  11. Fabricate(:email_domain_block, domain: 'example.com')
  12. expect(EmailDomainBlock.block?('nyarn@example.com')).to eq true
  13. end
  14. it 'returns true if the domain is not registed' do
  15. Fabricate(:email_domain_block, domain: 'example.com')
  16. expect(EmailDomainBlock.block?('nyarn@example.net')).to eq false
  17. end
  18. end
  19. end