X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c273b4b1faa6dd3d8aba3d5556605f683326948a..bec2340a448d2eaa9ffe2e2ca1980b31ae73c342:/test/functional/way_controller_test.rb?ds=sidebyside diff --git a/test/functional/way_controller_test.rb b/test/functional/way_controller_test.rb index de23545f7..607f2dc6f 100644 --- a/test/functional/way_controller_test.rb +++ b/test/functional/way_controller_test.rb @@ -164,7 +164,7 @@ class WayControllerTest < ActionController::TestCase # expect failure assert_response :precondition_failed, "way upload with invalid node did not return 'precondition failed'" - assert_equal "Precondition failed: Way requires the node with id 0, which either does not exist, or is not visible.", @response.body + assert_equal "Precondition failed: Way requires the nodes with id in (0), which either do not exist, or are not visible.", @response.body # create a way with no nodes content "" + @@ -182,6 +182,16 @@ class WayControllerTest < ActionController::TestCase # expect failure assert_response :conflict, "way upload to closed changeset did not return 'conflict'" + + # create a way with a tag which is too long + content "" + + "" + + "" + + "" + put :create + # expect failure + assert_response :bad_request, + "way upload to with too long tag did not return 'bad_request'" end # ------------------------------------- @@ -339,7 +349,7 @@ class WayControllerTest < ActionController::TestCase put :update, :id => current_ways(:visible_way).id assert_response :bad_request, "adding a duplicate tag to a way should fail with 'bad request'" - assert_equal "Element way/#{current_ways(:visible_way).id} has duplicate tags with key #{current_way_tags(:t1).k}.", @response.body + assert_equal "Element way/#{current_ways(:visible_way).id} has duplicate tags with key #{current_way_tags(:t1).k}", @response.body end ## @@ -386,7 +396,7 @@ class WayControllerTest < ActionController::TestCase put :update, :id => current_ways(:visible_way).id assert_response :bad_request, "adding new duplicate tags to a way should fail with 'bad request'" - assert_equal "Element way/#{current_ways(:visible_way).id} has duplicate tags with key i_am_a_duplicate.", @response.body + assert_equal "Element way/#{current_ways(:visible_way).id} has duplicate tags with key i_am_a_duplicate", @response.body end @@ -426,7 +436,7 @@ class WayControllerTest < ActionController::TestCase put :create assert_response :bad_request, "adding new duplicate tags to a way should fail with 'bad request'" - assert_equal "Element way/ has duplicate tags with key addr:housenumber.", @response.body + assert_equal "Element way/ has duplicate tags with key addr:housenumber", @response.body end ##