X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/03408b6294e0aa56d46823c1f44d47aaf69e226b..6b44a1976cf07ba50ba8aed8b34434e69a45e62d:/test/controllers/way_controller_test.rb?ds=sidebyside diff --git a/test/controllers/way_controller_test.rb b/test/controllers/way_controller_test.rb index b93a13759..3d466de8b 100644 --- a/test/controllers/way_controller_test.rb +++ b/test/controllers/way_controller_test.rb @@ -105,7 +105,7 @@ class WayControllerTest < ActionController::TestCase end # check error when a non-existent way is included - get :ways, :params => { :ways => "#{way1.id},#{way2.id},#{way3.id},#{way4.id},400" } + get :ways, :params => { :ways => "#{way1.id},#{way2.id},#{way3.id},#{way4.id},0" } assert_response :not_found end @@ -128,8 +128,8 @@ class WayControllerTest < ActionController::TestCase changeset_id = private_changeset.id # create a way with pre-existing nodes - content "" + - "" + + content "" \ + "" \ "" put :create # hope for failure @@ -143,8 +143,8 @@ class WayControllerTest < ActionController::TestCase changeset_id = changeset.id # create a way with pre-existing nodes - content "" + - "" + + content "" \ + "" \ "" put :create # hope for success @@ -188,7 +188,7 @@ class WayControllerTest < ActionController::TestCase # use the first user's open changeset # create a way with non-existing node - content "" + + content "" \ "" put :create # expect failure @@ -196,7 +196,7 @@ class WayControllerTest < ActionController::TestCase "way upload with invalid node using a private user did not return 'forbidden'" # create a way with no nodes - content "" + + content "" \ "" put :create # expect failure @@ -204,7 +204,7 @@ class WayControllerTest < ActionController::TestCase "way upload with no node using a private userdid not return 'forbidden'" # create a way inside a closed changeset - content "" + + content "" \ "" put :create # expect failure @@ -216,7 +216,7 @@ class WayControllerTest < ActionController::TestCase # use the first user's open changeset # create a way with non-existing node - content "" + + content "" \ "" put :create # expect failure @@ -225,7 +225,7 @@ class WayControllerTest < ActionController::TestCase 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 "" + + content "" \ "" put :create # expect failure @@ -234,7 +234,7 @@ class WayControllerTest < ActionController::TestCase assert_equal "Precondition failed: Cannot create way: data is invalid.", @response.body # create a way inside a closed changeset - content "" + + content "" \ "" put :create # expect failure @@ -242,9 +242,9 @@ class WayControllerTest < ActionController::TestCase "way upload to closed changeset did not return 'conflict'" # create a way with a tag which is too long - content "" + - "" + - "" + + content "" \ + "" \ + "" \ "" put :create # expect failure @@ -278,7 +278,7 @@ class WayControllerTest < ActionController::TestCase assert_response :unauthorized # now set auth using the private user - basic_authorization(private_user.email, "test") + basic_authorization private_user.email, "test" # this shouldn't work as with the 0.6 api we need pay load to delete delete :delete, :params => { :id => private_way.id } @@ -327,7 +327,7 @@ class WayControllerTest < ActionController::TestCase ### Now check with a public user # now set auth - basic_authorization(user.email, "test") + basic_authorization user.email, "test" # this shouldn't work as with the 0.6 api we need pay load to delete delete :delete, :params => { :id => way.id } @@ -397,7 +397,7 @@ class WayControllerTest < ActionController::TestCase ## Second test with the private user # setup auth - basic_authorization(private_user.email, "test") + basic_authorization private_user.email, "test" ## trying to break changesets @@ -435,7 +435,7 @@ class WayControllerTest < ActionController::TestCase ## Finally test with the public user # setup auth - basic_authorization(user.email, "test") + basic_authorization user.email, "test" ## trying to break changesets @@ -519,7 +519,7 @@ class WayControllerTest < ActionController::TestCase ## Try with the non-public user # setup auth - basic_authorization(private_user.email, "test") + basic_authorization private_user.email, "test" # add an identical tag to the way tag_xml = XML::Node.new("tag") @@ -538,7 +538,7 @@ class WayControllerTest < ActionController::TestCase ## Now try with the public user # setup auth - basic_authorization(user.email, "test") + basic_authorization user.email, "test" # add an identical tag to the way tag_xml = XML::Node.new("tag") @@ -569,7 +569,7 @@ class WayControllerTest < ActionController::TestCase ## Try with the non-public user # setup auth - basic_authorization(private_user.email, "test") + basic_authorization private_user.email, "test" # add an identical tag to the way tag_xml = XML::Node.new("tag") @@ -588,7 +588,7 @@ class WayControllerTest < ActionController::TestCase ## Now try with the public user # setup auth - basic_authorization(user.email, "test") + basic_authorization user.email, "test" # add an identical tag to the way tag_xml = XML::Node.new("tag") @@ -617,7 +617,7 @@ class WayControllerTest < ActionController::TestCase ## First test with the non-public user so should be rejected # setup auth - basic_authorization(private_user.email, "test") + basic_authorization private_user.email, "test" # create duplicate tag tag_xml = XML::Node.new("tag") @@ -638,7 +638,7 @@ class WayControllerTest < ActionController::TestCase ## Now test with the public user # setup auth - basic_authorization(user.email, "test") + basic_authorization user.email, "test" # create duplicate tag tag_xml = XML::Node.new("tag") @@ -671,7 +671,7 @@ class WayControllerTest < ActionController::TestCase ## First make sure that you can't with a non-public user # setup auth - basic_authorization(private_user.email, "test") + basic_authorization private_user.email, "test" # add the tag into the existing xml way_str = "" @@ -687,7 +687,7 @@ class WayControllerTest < ActionController::TestCase ## Now do it with a public user # setup auth - basic_authorization(user.email, "test") + basic_authorization user.email, "test" # add the tag into the existing xml way_str = ""