]> git.openstreetmap.org Git - rails.git/blobdiff - test/functional/changeset_controller_test.rb
Added test for changeset/download hiding redacted elements
[rails.git] / test / functional / changeset_controller_test.rb
index a586b3dee77ea43b9e30effa7e784afc7e2e83a9..8bba90975a3f0cddf3fc017dc917bfc2b2d97faf 100644 (file)
@@ -1747,6 +1747,22 @@ EOF
     assert_template 'user/no_such_user'
   end
   
+  ##
+  # check that the changeset download for a changeset with a redacted
+  # element in it doesn't contain that element.
+  def test_diff_download_redacted
+    changeset_id = changesets(:public_user_first_change).id
+
+    get :download, :id => changeset_id
+    assert_response :success
+
+    assert_select "osmChange", 1
+    # this changeset contains node 17 in versions 1 & 2, but 1 should
+    # be hidden.
+    assert_select "osmChange node[id=17]", 1
+    assert_select "osmChange node[id=17][version=1]", 0
+  end
+
   #------------------------------------------------------------
   # utility functions
   #------------------------------------------------------------