mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
parent
a8dd176cf6
commit
3ef38768a5
3 changed files with 16 additions and 13 deletions
|
@ -1,13 +0,0 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Nameserver do
|
||||
describe '::hostnames', db: false do
|
||||
before :example do
|
||||
expect(described_class).to receive(:pluck).with(:hostname).and_return('hostnames')
|
||||
end
|
||||
|
||||
it 'returns names' do
|
||||
expect(described_class.hostnames).to eq('hostnames')
|
||||
end
|
||||
end
|
||||
end
|
12
test/fixtures/nameservers.yml
vendored
12
test/fixtures/nameservers.yml
vendored
|
@ -1,3 +1,15 @@
|
|||
ns1:
|
||||
hostname: ns1.bestnames.test
|
||||
ipv4:
|
||||
- 192.0.2.1
|
||||
ipv6:
|
||||
- 2001:DB8::1
|
||||
domain: shop
|
||||
|
||||
ns2:
|
||||
hostname: ns2.bestnames.test
|
||||
ipv4:
|
||||
- 192.0.2.2
|
||||
ipv6:
|
||||
- 2001:DB8::2
|
||||
domain: shop
|
||||
|
|
|
@ -20,4 +20,8 @@ class NameserverTest < ActiveSupport::TestCase
|
|||
@nameserver.validate
|
||||
assert @nameserver.invalid?
|
||||
end
|
||||
|
||||
def test_hostnames
|
||||
assert_equal %w[ns1.bestnames.test ns2.bestnames.test], Nameserver.hostnames
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue