Skip to content
Snippets Groups Projects
Unverified Commit b22bfae4 authored by Matt Jankowski's avatar Matt Jankowski Committed by GitHub
Browse files

Add coverage for `DomainBlock#public_domain` method (#25283)

parent fb5bf5cb
No related branches found
No related tags found
No related merge requests found
......@@ -91,4 +91,22 @@ RSpec.describe DomainBlock do
expect(newer.stricter_than?(older)).to be false
end
end
describe '#public_domain' do
context 'with a domain block that is obfuscated' do
let(:domain_block) { Fabricate(:domain_block, domain: 'hostname.example.com', obfuscate: true) }
it 'garbles the domain' do
expect(domain_block.public_domain).to eq 'hostna**.******e.com'
end
end
context 'with a domain block that is not obfuscated' do
let(:domain_block) { Fabricate(:domain_block, domain: 'example.com', obfuscate: false) }
it 'returns the domain value' do
expect(domain_block.public_domain).to eq 'example.com'
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment