Sha256: 651e02956cccff9778e00be7c032f550f06d717a7ab544e1857f61d37f7161cd

Contents?: true

Size: 1.13 KB

Versions: 33

Compression:

Stored size: 1.13 KB

Contents

require 'test_helper'

class LinkTest < Zena::Unit::TestCase

  def test_link_through
    node = secure!(Node) { nodes(:cleanWater) }
    link = Link.find_through(node, links_id(:status_hot_for_cleanWater))
    assert_equal 'hot', link.role
  end

  def test_update_attributes_with_transformations
    login(:lion)
    node = secure!(Node) { nodes(:cleanWater) }
    assert_equal nodes_id(:status), node.find(:first, 'hot')[:id]
    link = Link.find_through(node, links_id(:status_hot_for_cleanWater))
    link.update_attributes_with_transformations('role' => 'hot', 'other_id' => nodes_zip(:lake), 'comment' => 'pop')
    assert_equal 'hot', link.role
    assert_equal nodes_zip(:lake), link.other_zip
    # change propagated to caller node.
    assert_equal 'pop', node.l_comment
    node = secure!(Node) { nodes(:cleanWater) }
    assert_equal nodes_id(:lake), node.find(:first, 'hot')[:id]
  end

  def test_node_zip
    login(:lion)
    node = secure!(Node) { nodes(:zena) }
    assert link = Link.find_through(node, links_id(:opening_in_zena))
    assert_equal nodes_zip(:zena), link.this_zip
    assert_equal nodes_zip(:opening), link.other_zip
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
zena-1.2.8 test/unit/link_test.rb
zena-1.2.7 test/unit/link_test.rb
zena-1.2.6 test/unit/link_test.rb
zena-1.2.5 test/unit/link_test.rb
zena-1.2.4 test/unit/link_test.rb
zena-1.2.3 test/unit/link_test.rb
zena-1.2.2 test/unit/link_test.rb
zena-1.2.1 test/unit/link_test.rb
zena-1.2.0 test/unit/link_test.rb
zena-1.1.3 test/unit/link_test.rb
zena-1.1.2 test/unit/link_test.rb
zena-1.1.1 test/unit/link_test.rb
zena-1.1.0 test/unit/link_test.rb
zena-1.0.0 test/unit/link_test.rb
zena-1.0.0.rc3 test/unit/link_test.rb
zena-1.0.0.rc2 test/unit/link_test.rb
zena-1.0.0.rc1 test/unit/link_test.rb
zena-0.16.9 test/unit/link_test.rb
zena-1.0.0.beta3 test/unit/link_test.rb
zena-0.16.8 test/unit/link_test.rb