From a65cb8428867d92d76bbf051bbd4614966636cf5 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 11 Nov 2020 16:43:58 +0000 Subject: [PATCH] Remove unused code --- app/models/user.rb | 20 -------------------- test/models/user_test.rb | 20 -------------------- 2 files changed, 40 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 7e1f1c6d6..9cc8b7d83 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -153,26 +153,6 @@ class User < ApplicationRecord user end - def to_xml - doc = OSM::API.new.get_xml_doc - doc.root << to_xml_node - doc - end - - def to_xml_node - el1 = XML::Node.new "user" - el1["display_name"] = display_name.to_s - el1["account_created"] = creation_time.xmlschema - if home_lat && home_lon - home = XML::Node.new "home" - home["lat"] = home_lat.to_s - home["lon"] = home_lon.to_s - home["zoom"] = home_zoom.to_s - el1 << home - end - el1 - end - def description RichText.new(self[:description_format], self[:description]) end diff --git a/test/models/user_test.rb b/test/models/user_test.rb index 330f40df2..58c1d174b 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -268,24 +268,4 @@ class UserTest < ActiveSupport::TestCase assert_not user.visible? assert_not user.active? end - - def test_to_xml - user = build(:user, :with_home_location) - xml = user.to_xml - assert_select Nokogiri::XML::Document.parse(xml.to_s), "user" do - assert_select "[display_name=?]", user.display_name - assert_select "[account_created=?]", user.creation_time.xmlschema - assert_select "home[lat=?][lon=?][zoom=?]", user.home_lat.to_s, user.home_lon.to_s, user.home_zoom.to_s - end - end - - def test_to_xml_node - user = build(:user, :with_home_location) - xml = user.to_xml_node - assert_select Nokogiri::XML::DocumentFragment.parse(xml.to_s), "user" do - assert_select "[display_name=?]", user.display_name - assert_select "[account_created=?]", user.creation_time.xmlschema - assert_select "home[lat=?][lon=?][zoom=?]", user.home_lat.to_s, user.home_lon.to_s, user.home_zoom.to_s - end - end end -- 2.39.5