summaryrefslogtreecommitdiff
path: root/test/unit/config_object_list_test.rb
blob: ecb6d4eafa0e14e16592da62ecf8b6a90cda47fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require File.dirname(__FILE__) + '/test_helper'

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