X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/297b0a0e166bab17cc6555deeefaf328f202bd72..98caf18dc32a201887f7a973542893661da625f1:/test/models/node_test.rb?ds=inline diff --git a/test/models/node_test.rb b/test/models/node_test.rb index c53f0ee1d..5f63251ee 100644 --- a/test/models/node_test.rb +++ b/test/models/node_test.rb @@ -3,47 +3,56 @@ require "test_helper" class NodeTest < ActiveSupport::TestCase def test_node_too_far_north node = build(:node, :latitude => 90.01 * OldNode::SCALE) - assert_equal false, node.valid? + node.validate + assert node.errors.full_messages.include?("Node is not in the world") end def test_node_north_limit node = build(:node, :latitude => 90 * OldNode::SCALE) - assert node.valid? + node.validate + assert_equal false, node.errors.full_messages.include?("Node is not in the world") end def test_node_too_far_south node = build(:node, :latitude => -90.01 * OldNode::SCALE) - assert_equal false, node.valid? + node.validate + assert node.errors.full_messages.include?("Node is not in the world") end def test_node_south_limit node = build(:node, :latitude => -90 * OldNode::SCALE) - assert node.valid? + node.validate + assert_equal false, node.errors.full_messages.include?("Node is not in the world") end def test_node_too_far_west node = build(:node, :longitude => -180.01 * OldNode::SCALE) - assert_equal false, node.valid? + node.validate + assert node.errors.full_messages.include?("Node is not in the world") end def test_node_west_limit node = build(:node, :longitude => -180 * OldNode::SCALE) - assert node.valid? + node.validate + assert_equal false, node.errors.full_messages.include?("Node is not in the world") end def test_node_too_far_east node = build(:node, :longitude => 180.01 * OldNode::SCALE) - assert_equal false, node.valid? + node.validate + assert node.errors.full_messages.include?("Node is not in the world") end def test_node_east_limit node = build(:node, :longitude => 180 * OldNode::SCALE) - assert node.valid? + node.validate + assert_equal false, node.errors.full_messages.include?("Node is not in the world") end def test_totally_wrong node = build(:node, :latitude => 200 * OldNode::SCALE, :longitude => 200 * OldNode::SCALE) - assert_equal false, node.valid? + node.validate + assert node.errors.full_messages.include?("Node is not in the world") end def test_lat_lon