From 786b8cce651d31afc9a3ae920f25f0d13b0314c0 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 30 Dec 2020 17:58:04 +0000 Subject: [PATCH] Verify that public and trackable traces don't return identity details --- .../api/tracepoints_controller_test.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/test/controllers/api/tracepoints_controller_test.rb b/test/controllers/api/tracepoints_controller_test.rb index 5b4f4ad84..fbe0450f2 100644 --- a/test/controllers/api/tracepoints_controller_test.rb +++ b/test/controllers/api/tracepoints_controller_test.rb @@ -38,7 +38,10 @@ module Api assert_response :success assert_select "gpx[version='1.0'][creator='OpenStreetMap.org']", :count => 1 do assert_select "trk" do - assert_select "trkseg" + assert_select "name", :count => 0 + assert_select "desc", :count => 0 + assert_select "url", :count => 0 + assert_select "trkseg", :count => 1 end end end @@ -57,7 +60,10 @@ module Api assert_response :success assert_select "gpx[version='1.0'][creator='OpenStreetMap.org']", :count => 1 do assert_select "trk", :count => 1 do - assert_select "trk > trkseg", :count => 2 do |trksegs| + assert_select "name", :count => 0 + assert_select "desc", :count => 0 + assert_select "url", :count => 0 + assert_select "trkseg", :count => 2 do |trksegs| trksegs.each do |trkseg| assert_select trkseg, "trkpt", :count => 1 do |trkpt| assert_select trkpt[0], "time", :count => 1 @@ -81,9 +87,9 @@ module Api assert_response :success assert_select "gpx[version='1.0'][creator='OpenStreetMap.org']", :count => 1 do assert_select "trk", :count => 1 do - assert_select "trk>name", :count => 1 - assert_select "trk>desc", :count => 1 - assert_select "trk>url", :count => 1 + assert_select "name", :count => 1 + assert_select "desc", :count => 1 + assert_select "url", :count => 1 assert_select "trkseg", :count => 1 do assert_select "trkpt", :count => 1 do assert_select "time", :count => 1 -- 2.39.5