]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/way_controller_test.rb
Merge branch 'authz' of https://github.com/rubyforgood/openstreetmap-website into...
[rails.git] / test / controllers / way_controller_test.rb
index 415033b48412400197d4477f197bcada8df19fb1..3d466de8bbfca3893c9182173b7255c8f1f81e8b 100644 (file)
@@ -105,7 +105,7 @@ class WayControllerTest < ActionController::TestCase
     end
 
     # check error when a non-existent way is included
     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
 
     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
     changeset_id = private_changeset.id
 
     # create a way with pre-existing nodes
-    content "<osm><way changeset='#{changeset_id}'>" +
-            "<nd ref='#{node1.id}'/><nd ref='#{node2.id}'/>" +
+    content "<osm><way changeset='#{changeset_id}'>" \
+            "<nd ref='#{node1.id}'/><nd ref='#{node2.id}'/>" \
             "<tag k='test' v='yes' /></way></osm>"
     put :create
     # hope for failure
             "<tag k='test' v='yes' /></way></osm>"
     put :create
     # hope for failure
@@ -143,8 +143,8 @@ class WayControllerTest < ActionController::TestCase
     changeset_id = changeset.id
 
     # create a way with pre-existing nodes
     changeset_id = changeset.id
 
     # create a way with pre-existing nodes
-    content "<osm><way changeset='#{changeset_id}'>" +
-            "<nd ref='#{node1.id}'/><nd ref='#{node2.id}'/>" +
+    content "<osm><way changeset='#{changeset_id}'>" \
+            "<nd ref='#{node1.id}'/><nd ref='#{node2.id}'/>" \
             "<tag k='test' v='yes' /></way></osm>"
     put :create
     # hope for success
             "<tag k='test' v='yes' /></way></osm>"
     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
 
     # use the first user's open changeset
     # create a way with non-existing node
-    content "<osm><way changeset='#{private_open_changeset.id}'>" +
+    content "<osm><way changeset='#{private_open_changeset.id}'>" \
             "<nd ref='0'/><tag k='test' v='yes' /></way></osm>"
     put :create
     # expect failure
             "<nd ref='0'/><tag k='test' v='yes' /></way></osm>"
     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
                     "way upload with invalid node using a private user did not return 'forbidden'"
 
     # create a way with no nodes
-    content "<osm><way changeset='#{private_open_changeset.id}'>" +
+    content "<osm><way changeset='#{private_open_changeset.id}'>" \
             "<tag k='test' v='yes' /></way></osm>"
     put :create
     # expect failure
             "<tag k='test' v='yes' /></way></osm>"
     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
                     "way upload with no node using a private userdid not return 'forbidden'"
 
     # create a way inside a closed changeset
-    content "<osm><way changeset='#{private_closed_changeset.id}'>" +
+    content "<osm><way changeset='#{private_closed_changeset.id}'>" \
             "<nd ref='#{node.id}'/></way></osm>"
     put :create
     # expect failure
             "<nd ref='#{node.id}'/></way></osm>"
     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
 
     # use the first user's open changeset
     # create a way with non-existing node
-    content "<osm><way changeset='#{open_changeset.id}'>" +
+    content "<osm><way changeset='#{open_changeset.id}'>" \
             "<nd ref='0'/><tag k='test' v='yes' /></way></osm>"
     put :create
     # expect failure
             "<nd ref='0'/><tag k='test' v='yes' /></way></osm>"
     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
     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 "<osm><way changeset='#{open_changeset.id}'>" +
+    content "<osm><way changeset='#{open_changeset.id}'>" \
             "<tag k='test' v='yes' /></way></osm>"
     put :create
     # expect failure
             "<tag k='test' v='yes' /></way></osm>"
     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
     assert_equal "Precondition failed: Cannot create way: data is invalid.", @response.body
 
     # create a way inside a closed changeset
-    content "<osm><way changeset='#{closed_changeset.id}'>" +
+    content "<osm><way changeset='#{closed_changeset.id}'>" \
             "<nd ref='#{node.id}'/></way></osm>"
     put :create
     # expect failure
             "<nd ref='#{node.id}'/></way></osm>"
     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
                     "way upload to closed changeset did not return 'conflict'"
 
     # create a way with a tag which is too long
-    content "<osm><way changeset='#{open_changeset.id}'>" +
-            "<nd ref='#{node.id}'/>" +
-            "<tag k='foo' v='#{'x' * 256}'/>" +
+    content "<osm><way changeset='#{open_changeset.id}'>" \
+            "<nd ref='#{node.id}'/>" \
+            "<tag k='foo' v='#{'x' * 256}'/>" \
             "</way></osm>"
     put :create
     # expect failure
             "</way></osm>"
     put :create
     # expect failure