Improve test coverage

This commit is contained in:
Tom Hughes 2015-02-27 00:40:37 +00:00
parent f8f921e09d
commit f04211b172
16 changed files with 174 additions and 44 deletions

View file

@ -18,6 +18,7 @@ module GeocoderHelper
html << result[:prefix] if result[:prefix]
html << " " if result[:prefix] && result[:name]
html << link_to(result[:name], url, html_options) if result[:name]
html << " " if result[:suffix] && result[:name]
html << result[:suffix] if result[:suffix]
html.html_safe
end

View file

@ -120,10 +120,6 @@ class Changeset < ActiveRecord::Base
self.num_changes += elements
end
def tags_as_hash
tags
end
def tags
unless @tags
@tags = {}

View file

@ -93,11 +93,6 @@ class OldRelation < ActiveRecord::Base
el
end
# Temporary method to match interface to nodes
def tags_as_hash
tags
end
# Temporary method to match interface to relations
def relation_members
old_members

View file

@ -116,11 +116,6 @@ class OldWay < ActiveRecord::Base
points
end
# Temporary method to match interface to nodes
def tags_as_hash
tags
end
# Temporary method to match interface to ways
def way_nodes
old_nodes

View file

@ -262,11 +262,6 @@ class Relation < ActiveRecord::Base
true
end
# Temporary method to match interface to nodes
def tags_as_hash
tags
end
##
# if any members are referenced by placeholder IDs (i.e: negative) then
# this calling this method will fix them using the map from placeholders

View file

@ -83,16 +83,6 @@ class Way < ActiveRecord::Base
way
end
# Find a way given it's ID, and in a single SQL call also grab its nodes
#
# You can't pull in all the tags too unless we put a sequence_id on the way_tags table and have a multipart key
def self.find_eager(id)
Way.find(id, :include => { :way_nodes => :node })
# If waytag had a multipart key that was real, you could do this:
# Way.find(id, :include => [:way_tags, {:way_nodes => :node}])
end
# Find a way given it's ID, and in a single SQL call also grab its nodes and tags
def to_xml
doc = OSM::API.new.get_xml_doc
@ -242,11 +232,6 @@ class Way < ActiveRecord::Base
end
end
# Temporary method to match interface to nodes
def tags_as_hash
tags
end
##
# if any referenced nodes are placeholder IDs (i.e: are negative) then
# this calling this method will fix them using the map from placeholders