Added test for changeset/download hiding redacted elements

This commit is contained in:
Matt Amos 2012-03-29 16:12:01 +01:00 committed by Tom Hughes
parent d9e4e5836f
commit e01a309970
2 changed files with 21 additions and 4 deletions

View file

@ -143,10 +143,11 @@ class ChangesetController < ApplicationController
def download
changeset = Changeset.find(params[:id])
# get all the elements in the changeset and stick them in a big array.
elements = [changeset.old_nodes,
changeset.old_ways,
changeset.old_relations].flatten
# get all the elements in the changeset which haven't been redacted
# and stick them in a big array.
elements = [changeset.old_nodes.unredacted,
changeset.old_ways.unredacted,
changeset.old_relations.unredacted].flatten
# sort the elements by timestamp and version number, as this is the
# almost sensible ordering available. this would be much nicer if