<%= render :partial => "browse/node", :object => @feature %>
-<div class='secondary-actions'>
- <%= link_to t("browse.download_xml"), node_version_path(*@feature.id) %>
-</div>
+<% unless @feature.redacted? %>
+ <div class='secondary-actions'>
+ <%= link_to t("browse.download_xml"), node_version_path(*@feature.id) %>
+ </div>
+<% end %>
<%= render :partial => "browse/relation", :object => @feature %>
-<div class='secondary-actions'>
- <%= link_to t("browse.download_xml"), relation_version_path(*@feature.id) %>
-</div>
+<% unless @feature.redacted? %>
+ <div class='secondary-actions'>
+ <%= link_to t("browse.download_xml"), relation_version_path(*@feature.id) %>
+ </div>
+<% end %>
<%= render :partial => "browse/way", :object => @feature %>
-<div class='secondary-actions'>
- <%= link_to t("browse.download_xml"), way_version_path(*@feature.id) %>
-</div>
+<% unless @feature.redacted? %>
+ <div class='secondary-actions'>
+ <%= link_to t("browse.download_xml"), way_version_path(*@feature.id) %>
+ </div>
+<% end %>
assert_select "a[href='#{node_version_path node, 1}']", :count => 1
end
+ def test_redacted
+ node = create(:node, :with_history, :deleted, :version => 2)
+ node_v1 = node.old_nodes.find_by(:version => 1)
+ node_v1.redact!(create(:redaction))
+ get old_node_path(node, 1)
+ assert_response :success
+ assert_template "old_nodes/show"
+ assert_template :layout => "map"
+ assert_select "a[href='#{old_node_path node, 1}']", :count => 0
+ assert_select "a[href='#{node_version_path node, 1}']", :count => 0
+ end
+
def test_not_found
get old_node_path(0, 0)
assert_response :not_found
assert_template :layout => "map"
end
+ def test_redacted
+ relation = create(:relation, :with_history, :deleted, :version => 2)
+ relation_v1 = relation.old_relations.find_by(:version => 1)
+ relation_v1.redact!(create(:redaction))
+ get old_relation_path(relation, 1)
+ assert_response :success
+ assert_template "old_relations/show"
+ assert_template :layout => "map"
+ assert_select "a[href='#{old_relation_path relation, 1}']", :count => 0
+ assert_select "a[href='#{relation_version_path relation, 1}']", :count => 0
+ end
+
def test_not_found
get old_relation_path(0, 0)
assert_response :not_found
assert_template :layout => "map"
end
+ def test_redacted
+ way = create(:way, :with_history, :deleted, :version => 2)
+ way_v1 = way.old_ways.find_by(:version => 1)
+ way_v1.redact!(create(:redaction))
+ get old_way_path(way, 1)
+ assert_response :success
+ assert_template "old_ways/show"
+ assert_template :layout => "map"
+ assert_select "a[href='#{old_way_path way, 1}']", :count => 0
+ assert_select "a[href='#{way_version_path way, 1}']", :count => 0
+ end
+
def test_not_found
get old_way_path(0, 0)
assert_response :not_found