1 require File.dirname(__FILE__) + '/../test_helper'
3 class WayTest < Test::Unit::TestCase
7 # Check that we have the correct number of currnet ways in the db
8 # This will need to updated whenever the current_ways.yml is updated
10 assert_equal 4, Way.count
14 node = current_nodes(:used_node_1)
17 :used_way ].each do |way_symbol|
18 way = current_ways(way_symbol)
19 assert_equal node.bbox, way.bbox
23 # Check that the preconditions fail when you are over the defined limit of
24 # the maximum number of nodes in each way.
25 def test_max_nodes_per_way_limit
26 # Take one of the current ways and add nodes to it until we are near the limit
27 way = Way.find(current_ways(:visible_way).id)
29 # it already has 1 node
30 1.upto((APP_CONFIG['max_number_of_way_nodes'])/2) {
31 way.add_nd_num(current_nodes(:used_node_1).id)
32 way.add_nd_num(current_nodes(:used_node_2).id)
37 way.add_nd_num(current_nodes(:visible_node).id)