mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
Refactor to nameserver
This commit is contained in:
parent
bc7c5d648b
commit
4ea7a7ad57
3 changed files with 19 additions and 10 deletions
|
@ -69,6 +69,17 @@ describe Domain do
|
|||
expect(d.name_dirty).to eq('test.ee')
|
||||
end
|
||||
|
||||
it 'normalizes ns attrs' do
|
||||
d = Fabricate(:domain)
|
||||
d.nameservers.build(hostname: 'BLA.EXAMPLE.EE', ipv4: ' 192.168.1.1', ipv6: '1080:0:0:0:8:800:200c:417a')
|
||||
d.save
|
||||
|
||||
ns = d.nameservers.last
|
||||
expect(ns.hostname).to eq('bla.example.ee')
|
||||
expect(ns.ipv4).to eq('192.168.1.1')
|
||||
expect(ns.ipv6).to eq('1080:0:0:0:8:800:200C:417A')
|
||||
end
|
||||
|
||||
it 'does not create a reserved domain' do
|
||||
Fabricate(:reserved_domain)
|
||||
expect(Fabricate.build(:domain, name: '1162.ee').valid?).to be false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue