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

Anton Khorev notifications at github.com
Sat Sep 9 13:59:07 UTC 2023


@AntonKhorev commented on this pull request.



> @@ -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 }
+      )

Most of assert_recognizes tests were added for paths differing from the default ones
https://github.com/openstreetmap/openstreetmap-website/commit/90e46a58de583ac2bd7bb43077faa94186957a7a

I guess it's not required here, so I removed it. And added JSON.

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

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


More information about the rails-dev mailing list