blob: 122c6cd39ed8f3e14c741c26dcacebbfdaa326ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
require File.expand_path('../test_helper', __FILE__)
class ConfigObjectListTest < MiniTest::Unit::TestCase
def test_node_search
nodes = manager.nodes['name' => 'vpn1']
assert_equal 1, nodes.size
assert_equal 'vpn1', nodes.values.first.name
end
def test_complex_node_search
domain = provider.domain
nodes = manager.nodes['dns.public' => true]
expected = [{"domain_full"=>"ns1.#{domain}"}, {"domain_full"=>"ns2.#{domain}"}, {"domain_full"=>"vpn1.#{domain}"}, {"domain_full"=>"web1.#{domain}"}]
assert_equal expected.size, nodes.size
assert_equal expected, nodes.fields('domain.full')
end
end
|