Add DomainResource
class to wrap MX lookup/normalize (#32864)
This commit is contained in:
parent
e8b6607ece
commit
62d65504f6
6 changed files with 46 additions and 19 deletions
19
spec/lib/domain_resource_spec.rb
Normal file
19
spec/lib/domain_resource_spec.rb
Normal file
|
@ -0,0 +1,19 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe DomainResource do
|
||||
describe '#mx' do
|
||||
subject { described_class.new(domain) }
|
||||
|
||||
let(:domain) { 'example.host' }
|
||||
let(:exchange) { 'mx.host' }
|
||||
|
||||
before { configure_mx(domain: domain, exchange: exchange) }
|
||||
|
||||
it 'returns array of hostnames' do
|
||||
expect(subject.mx)
|
||||
.to eq([exchange])
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue