From 096e5cb337088f4c787609b9788cad3e8607c0fa Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Mon, 5 May 2025 02:25:31 +0300 Subject: [PATCH] Create api capabilities resource --- config/routes.rb | 7 ++----- test/controllers/api/capabilities_controller_test.rb | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index b1f876114..3080d2366 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,15 +9,12 @@ OpenStreetMap::Application.routes.draw do # API namespace :api do - get "capabilities" => "capabilities#show" # Deprecated, remove when 0.6 support is removed + get "capabilities" => "capabilities#show", :as => nil # Deprecated, remove when 0.6 support is removed get "versions" => "versions#show" end - scope "api/0.6", :module => :api do - get "capabilities" => "capabilities#show" - end - namespace :api, :path => "api/0.6" do + resource :capabilities, :only => :show resource :permissions, :only => :show resources :changesets, :only => [:index, :create] diff --git a/test/controllers/api/capabilities_controller_test.rb b/test/controllers/api/capabilities_controller_test.rb index 7d2feed29..fe5fbf0b7 100644 --- a/test/controllers/api/capabilities_controller_test.rb +++ b/test/controllers/api/capabilities_controller_test.rb @@ -48,7 +48,7 @@ module Api end def test_capabilities_json - get api_capabilities_path, :params => { :format => "json" } + get api_capabilities_path(:format => "json") assert_response :success js = ActiveSupport::JSON.decode(@response.body) assert_not_nil js -- 2.39.5