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

class TestMeme < 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
    nodes = manager.nodes['dns.public' => true]
    expected = [{"domain_full"=>"ns1.rewire.co"}, {"domain_full"=>"ns2.rewire.co"}, {"domain_full"=>"vpn1.rewire.co"}, {"domain_full"=>"web1.rewire.co"}]
    assert_equal expected.size, nodes.size
    assert_equal expected, nodes.fields('domain.full')
  end



end