[openstreetmap/openstreetmap-website] Order of comments in changeset comments feeds (PR #4944)

David Tsiklauri notifications at github.com
Thu Jul 4 18:05:13 UTC 2024


@nertc commented on this pull request.



> @@ -46,6 +46,14 @@ def test_feed
         assert_select "item", :count => 3
       end
     end
+
+    # Gets comment Ids from HTML and checks that they are in descending order
+    last_comment_id = -1
+    @response.body.split("Changeset comment ")[1..].each_with_index do |data, index|

Thanks for comments. I agree with you, but when I parsed XML, the only id info was still in the CDATA containing HTML (fields exposed in the XML were identical for every comment e.g. comment creation time, because they are created with no delay). So even if I used parsed data, I would still use HTML raw string manipulation. Certainly, it's doable (and at first I did it that way), but it makes the test more complicated (so I rewrote it this way). If it's okay, test to be more complicated, I'll do it with XML parser, but I think this solution is already more complicated than the regular test should be.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4944#discussion_r1665980153
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4944/review/2159365453 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240704/ee50e621/attachment-0001.htm>


More information about the rails-dev mailing list