Sha256: 154a368faa0f38be9dbca9e1dbf005b41445a1250f4ee48b0e2c784817c018cf

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

require 'mail_autoconfig'

describe MailAutoconfig::EmailAddress do

  context 'example@gmail.com' do
    let(:address) { MailAutoconfig::EmailAddress.new('example@gmail.com') }

    it 'should have a gmail domain' do
      expect(address.domain).to eq('gmail.com')
    end

    it 'should have a local part' do
      expect(address.local_part).to eq('example')
    end

    it 'should have gmail MX domains' do
      expect(address.primary_mx_domain).to eq("google.com")
    end

    it 'should have a client config' do
      expect(address.client_config).to be_a(MailAutoconfig::ClientConfig)
    end

    it 'should have GMail as client config provider short name' do
      expect(address.client_config.short_name).to eq('GMail')
    end
  end

  context 'example@atechmedia.com' do
    let(:address) { MailAutoconfig::EmailAddress.new('example@atechmedia.com') }
    it 'should not have a detectable configuration' do
      expect(address.client_config).to be_false
    end
  end

  context 'example@swcp.com' do
    let(:address) { MailAutoconfig::EmailAddress.new('example@swcp.com') }
    it 'should have an autoconf configuration' do
      expect(address.client_config).to be_a(MailAutoconfig::ClientConfig)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mail_autoconfig-0.0.1 spec/email_address_spec.rb