]> git.openstreetmap.org Git - rails.git/commitdiff
Sort tags to make comparision stable
authorTom Hughes <tom@compton.nu>
Sun, 30 Jun 2013 21:41:49 +0000 (22:41 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 30 Jun 2013 21:41:49 +0000 (22:41 +0100)
test/functional/relation_controller_test.rb

index c62496cd699b80fb81b92f7e75def650d42a14e8..502404ccaa73a94338da754d53eaeea9c6ed93fe 100644 (file)
@@ -916,7 +916,7 @@ OSM
   ##
   # returns a k->v hash of tags from an xml doc
   def get_tags_as_hash(a) 
   ##
   # returns a k->v hash of tags from an xml doc
   def get_tags_as_hash(a) 
-    a.find("//osm/relation/tag").inject({}) do |h,v|
+    a.find("//osm/relation/tag").sort_by { |v| v['k'] }.inject({}) do |h,v|
       h[v['k']] = v['v']
       h
     end
       h[v['k']] = v['v']
       h
     end