X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/766246a9605bfa61cba8c6ef63676c233d206813..9ef85e42ba4a3b10157b2aa0711e68acaf9e3f9e:/test/controllers/amf_controller_test.rb diff --git a/test/controllers/amf_controller_test.rb b/test/controllers/amf_controller_test.rb index 554456837..13f01530d 100644 --- a/test/controllers/amf_controller_test.rb +++ b/test/controllers/amf_controller_test.rb @@ -306,7 +306,7 @@ class AmfControllerTest < ActionController::TestCase # NOTE: looks from the API changes that this now expects a timestamp # instead of a version number... # try to get version 1 - v1 = ways(:way_with_versions_v1) + v1 = ways(:way_with_versions_v2) { latest.id => "", v1.way_id => v1.timestamp.strftime("%d %b %Y, %H:%M:%S") }.each do |id, t| @@ -346,7 +346,7 @@ class AmfControllerTest < ActionController::TestCase end def test_getway_old_nonexistent - # try to get the last version+10 (shoudn't exist) + # try to get the last version-10 (shoudn't exist) v1 = ways(:way_with_versions_v1) # try to get last visible version of non-existent way # try to get specific version of non-existent way @@ -366,6 +366,23 @@ class AmfControllerTest < ActionController::TestCase end end + def test_getway_old_invisible + v1 = ways(:invisible_way) + # try to get deleted version + [[v1.way_id, (v1.timestamp + 10).strftime("%d %b %Y, %H:%M:%S")] + ].each do |id, t| + amf_content "getway_old", "/1", [id, t] + post :amf_read + assert_response :success + amf_parse_response + returned_way = amf_result("/1") + assert_equal -1, returned_way[0] + assert returned_way[3].nil? + assert returned_way[4].nil? + assert returned_way[5].nil? + end + end + def test_getway_history latest = current_ways(:way_with_versions) oldest = ways(:way_with_versions_v1)