X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/be0e33862fedbf02e52a9e126cac31dfb5775b43..17e6e69c39072d8e6cb316b75b311e89c92cca45:/test/controllers/api/map_controller_test.rb diff --git a/test/controllers/api/map_controller_test.rb b/test/controllers/api/map_controller_test.rb index 5ee5a9e6c..db83aaa9f 100644 --- a/test/controllers/api/map_controller_test.rb +++ b/test/controllers/api/map_controller_test.rb @@ -49,7 +49,7 @@ module Api print @response.body end assert_response :success, "Expected scucess with the map call" - assert_select "osm[version='#{API_VERSION}'][generator='#{GENERATOR}']", :count => 1 do + assert_select "osm[version='#{Settings.api_version}'][generator='#{Settings.generator}']", :count => 1 do assert_select "bounds[minlon='#{format('%.7f', minlon)}'][minlat='#{format('%.7f', minlat)}'][maxlon='#{format('%.7f', maxlon)}'][maxlat='#{format('%.7f', maxlat)}']", :count => 1 assert_select "node[id='#{node.id}'][lat='#{format('%.7f', node.lat)}'][lon='#{format('%.7f', node.lon)}'][version='#{node.version}'][changeset='#{node.changeset_id}'][visible='#{node.visible}'][timestamp='#{node.timestamp.xmlschema}']", :count => 1 do # This should really be more generic @@ -75,7 +75,7 @@ module Api bbox = "#{node.lon},#{node.lat},#{node.lon},#{node.lat}" get :index, :params => { :bbox => bbox } assert_response :success, "The map call should have succeeded" - assert_select "osm[version='#{API_VERSION}'][generator='#{GENERATOR}']", :count => 1 do + assert_select "osm[version='#{Settings.api_version}'][generator='#{Settings.generator}']", :count => 1 do assert_select "bounds[minlon='#{node.lon}'][minlat='#{node.lat}'][maxlon='#{node.lon}'][maxlat='#{node.lat}']", :count => 1 assert_select "node[id='#{node.id}'][lat='#{format('%.7f', node.lat)}'][lon='#{format('%.7f', node.lon)}'][version='#{node.version}'][changeset='#{node.changeset_id}'][visible='#{node.visible}'][timestamp='#{node.timestamp.xmlschema}']", :count => 1 do # This should really be more generic @@ -103,7 +103,7 @@ module Api bbox = "#{node.lon},#{node.lat},#{node.lon},#{node.lat}" get :index, :params => { :bbox => bbox } assert_response :success, "The map call should have succeeded" - assert_select "osm[version='#{API_VERSION}'][generator='#{GENERATOR}']", :count => 1 do + assert_select "osm[version='#{Settings.api_version}'][generator='#{Settings.generator}']", :count => 1 do assert_select "bounds[minlon='#{node.lon}'][minlat='#{node.lat}'][maxlon='#{node.lon}'][maxlat='#{node.lat}']", :count => 1 assert_select "node", :count => 3 assert_select "node[id='#{node.id}']", :count => 1 @@ -120,7 +120,7 @@ module Api def test_map_empty get :index, :params => { :bbox => "179.998,89.998,179.999.1,89.999" } assert_response :success, "The map call should have succeeded" - assert_select "osm[version='#{API_VERSION}'][generator='#{GENERATOR}']", :count => 1 do + assert_select "osm[version='#{Settings.api_version}'][generator='#{Settings.generator}']", :count => 1 do assert_select "bounds[minlon='179.9980000'][minlat='89.9980000'][maxlon='179.9990000'][maxlat='89.9990000']", :count => 1 assert_select "node", :count => 0 assert_select "way", :count => 0 @@ -138,7 +138,7 @@ module Api @badbigbbox.each do |bbox| get :index, :params => { :bbox => bbox } assert_response :bad_request, "The bbox:#{bbox} was expected to be too big" - assert_equal "The maximum bbox size is #{MAX_REQUEST_AREA}, and your request was too large. Either request a smaller area, or use planet.osm", @response.body, "bbox: #{bbox}" + assert_equal "The maximum bbox size is #{Settings.max_request_area}, and your request was too large. Either request a smaller area, or use planet.osm", @response.body, "bbox: #{bbox}" end end