[openstreetmap/openstreetmap-website] Add show user block api endpoint (PR #4240)

Tom Hughes notifications at github.com
Fri Sep 8 17:14:52 UTC 2023


@tomhughes commented on this pull request.

Should we be adding JSON output as well?

> @@ -0,0 +1,30 @@
+require "test_helper"
+
+module Api
+  class UserBlocksControllerTest < ActionDispatch::IntegrationTest
+    def test_routes
+      assert_routing(
+        { :path => "/api/0.6/user_blocks/1", :method => :get },
+        { :controller => "api/user_blocks", :action => "show", :id => "1" }
+      )
+      assert_recognizes(
+        { :controller => "api/user_blocks", :action => "show", :id => "1", :format => "xml" },
+        { :path => "/api/0.6/user_blocks/1.xml", :method => :get }
+      )

We don't normally make the XML case explicit like that though I guess maybe we should have implicit and explicit cases for it but looking at other API controller tests at the moment only the JSON ones are explicit.

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

Message ID: <openstreetmap/openstreetmap-website/pull/4240/review/1617936377 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230908/e5b6be65/attachment.htm>


More information about the rails-dev mailing list