Don't try and match xmlns as an attribute

This doesn't seem to work with the new nokogiri based matching
in rails 4.2 probably because the attribute is removed by the
parser and used to set the namespace of the element.
This commit is contained in:
Tom Hughes 2015-01-10 15:36:44 +00:00
parent 8fa9763281
commit 7f81de2065

View file

@ -102,7 +102,7 @@ class ApiControllerTest < ActionController::TestCase
bbox = "#{minlon},#{minlat},#{maxlon},#{maxlat}" bbox = "#{minlon},#{minlat},#{maxlon},#{maxlat}"
get :trackpoints, :bbox => bbox get :trackpoints, :bbox => bbox
assert_response :success assert_response :success
assert_select "gpx[version='1.0'][creator='OpenStreetMap.org'][xmlns='http://www.topografix.com/GPX/1/0']", :count => 1 do assert_select "gpx[version='1.0'][creator='OpenStreetMap.org']", :count => 1 do
assert_select "trk" do assert_select "trk" do
assert_select "trkseg" assert_select "trkseg"
end end
@ -118,7 +118,7 @@ class ApiControllerTest < ActionController::TestCase
bbox = "#{minlon},#{minlat},#{maxlon},#{maxlat}" bbox = "#{minlon},#{minlat},#{maxlon},#{maxlat}"
get :trackpoints, :bbox => bbox get :trackpoints, :bbox => bbox
assert_response :success assert_response :success
assert_select "gpx[version='1.0'][creator='OpenStreetMap.org'][xmlns='http://www.topografix.com/GPX/1/0']", :count => 1 do assert_select "gpx[version='1.0'][creator='OpenStreetMap.org']", :count => 1 do
assert_select "trk", :count => 1 do assert_select "trk", :count => 1 do
assert_select "trk > trkseg", :count => 2 do |trksegs| assert_select "trk > trkseg", :count => 2 do |trksegs|
trksegs.each do |trkseg| trksegs.each do |trkseg|
@ -140,7 +140,7 @@ class ApiControllerTest < ActionController::TestCase
bbox = "#{minlon},#{minlat},#{maxlon},#{maxlat}" bbox = "#{minlon},#{minlat},#{maxlon},#{maxlat}"
get :trackpoints, :bbox => bbox get :trackpoints, :bbox => bbox
assert_response :success assert_response :success
assert_select "gpx[version='1.0'][creator='OpenStreetMap.org'][xmlns='http://www.topografix.com/GPX/1/0']", :count => 1 do assert_select "gpx[version='1.0'][creator='OpenStreetMap.org']", :count => 1 do
assert_select "trk", :count => 1 do assert_select "trk", :count => 1 do
assert_select "trk>name", :count => 1 assert_select "trk>name", :count => 1
assert_select "trk>desc", :count => 1 assert_select "trk>desc", :count => 1