X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/cd81a3f60506cc0da60a0c84e04f9ed63c9bfe9f..42b329ed82c7899b970e1f0fd8d6d29fd625f7d5:/test/unit/old_way_test.rb diff --git a/test/unit/old_way_test.rb b/test/unit/old_way_test.rb index 909f9de1e..44975d153 100644 --- a/test/unit/old_way_test.rb +++ b/test/unit/old_way_test.rb @@ -87,4 +87,18 @@ class OldWayTest < ActiveSupport::TestCase assert_equal "added in way version 3", tags["testing"] assert_equal "modified in way version 4", tags["testing two"] end + + def test_get_nodes_undelete + way = ways(:way_with_versions_v3) + nodes = OldWay.find(way.id).get_nodes_undelete + assert_equal 2, nodes.size + assert_equal [1.0, 1.0, 15, 4, {"testing" => "added in node version 3", "testing two" => "modified in node version 4"}, true], nodes[0] + assert_equal [3.0, 3.0, 3, 1, {"test" => "yes"}, true], nodes[1] + + way = ways(:way_with_redacted_versions_v2) + nodes = OldWay.find(way.id).get_nodes_undelete + assert_equal 2, nodes.size + assert_equal [3.0, 3.0, 3, 1, {"test" => "yes"}, true], nodes[0] + assert_equal [2.0, 2.0, 2, 1, {"testused" => "yes"}, false], nodes[1] + end end