[openstreetmap/openstreetmap-website] Remove Node.to_xml (#2433)
Andy Allan
notifications at github.com
Wed Nov 13 16:41:35 UTC 2019
The `.to_xml` and `.to_xml_node` methods are only used in the tests, for creating 'fixture'-style payloads, and aren't used by the application code. This PR moves those methods into the tests as helper methods.
It also changes the lat/lon formatting test, to test the rendered response from the controller. This should probably have been done when the output was refactored to use the xml builders, but I overlooked this during that review.
Followup work involves doing similar work for the other elements with .to_xml methods.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/2433
-- Commit Summary --
* Move the format tests to test the output from the controller
* Move Node.to_xml and to_xml_node out of model and into tests
-- File Changes --
M app/models/node.rb (22)
M test/controllers/api/changesets_controller_test.rb (10)
M test/controllers/api/nodes_controller_test.rb (81)
M test/controllers/api/old_nodes_controller_test.rb (4)
M test/models/node_test.rb (8)
M test/test_helper.rb (26)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/2433.patch
https://github.com/openstreetmap/openstreetmap-website/pull/2433.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2433
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20191113/74f8eb4d/attachment.html>
More information about the rails-dev
mailing list