]> git.openstreetmap.org Git - rails.git/commitdiff
Move changeset comment feeds out of the API namespace
authorTom Hughes <tom@compton.nu>
Thu, 23 Oct 2014 20:40:13 +0000 (21:40 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 23 Oct 2014 20:40:13 +0000 (21:40 +0100)
config/routes.rb
test/controllers/changeset_controller_test.rb

index 789c22c9b763d3d653713bc60c698370eea8041f..8cbf8f900c06f2305a5067c3ea6524914fff1388 100644 (file)
@@ -15,7 +15,6 @@ OpenStreetMap::Application.routes.draw do
   match 'api/0.6/changeset/:id/close' => 'changeset#close', :via => :put, :id => /\d+/
   match 'api/0.6/changesets' => 'changeset#query', :via => :get
   post 'api/0.6/changeset/:id/comment' => 'changeset#comment', :as => :changeset_comment, :id => /\d+/
-  get 'api/0.6/changeset(/:id)/comments/feed' => 'changeset#comments_feed', :as => :changeset_comments_feed, :id => /\d*/, :defaults => { :format => 'rss' }
   post 'api/0.6/changeset/comment/:id/hide' => 'changeset#hide_comment', :as => :changeset_comment_hide, :id => /\d+/
   post 'api/0.6/changeset/comment/:id/unhide' => 'changeset#unhide_comment', :as => :changeset_comment_unhide, :id => /\d+/
 
@@ -115,6 +114,7 @@ OpenStreetMap::Application.routes.draw do
   match '/relation/:id' => 'browse#relation', :via => :get, :id => /\d+/, :as => :relation
   match '/relation/:id/history' => 'browse#relation_history', :via => :get, :id => /\d+/
   match '/changeset/:id' => 'browse#changeset', :via => :get, :as => :changeset, :id => /\d+/
+  match '/changeset/:id/comments/feed' => 'changeset#comments_feed', :via => :get, :as => :changeset_comments_feed, :id => /\d*/, :defaults => { :format => 'rss' }
   match '/note/:id' => 'browse#note', :via => :get, :id => /\d+/, :as => "browse_note"
   match '/note/new' => 'browse#new_note', :via => :get
   match '/user/:display_name/history' => 'changeset#list', :via => :get
@@ -150,6 +150,7 @@ OpenStreetMap::Application.routes.draw do
   match '/about' => 'site#about', :via => :get, :as => :about
   match '/history' => 'changeset#list', :via => :get
   match '/history/feed' => 'changeset#feed', :via => :get, :defaults => { :format => :atom }
+  match '/history/comments/feed' => 'changeset#comments_feed', :via => :get, :as => :changesets_comments_feed, :defaults => { :format => 'rss' }
   match '/export' => 'site#export', :via => :get
   match '/login' => 'user#login', :via => [:get, :post]
   match '/logout' => 'user#logout', :via => [:get, :post]
index e4c2903e0a1c735a1e1c9781df7bd32ef6274c00..4617383303aeb34203414db00a2b09e39f0ad4d5 100644 (file)
@@ -29,12 +29,12 @@ class ChangesetControllerTest < ActionController::TestCase
       { :controller => "changeset", :action => "read", :id => "1" }
     )
     assert_routing(
-        { :path => "/api/0.6/changeset/1/subscribe", :method => :post },
-        { :controller => "changeset", :action => "subscribe", :id => "1" }
+      { :path => "/api/0.6/changeset/1/subscribe", :method => :post },
+      { :controller => "changeset", :action => "subscribe", :id => "1" }
     )
     assert_routing(
-        { :path => "/api/0.6/changeset/1/unsubscribe", :method => :post },
-        { :controller => "changeset", :action => "unsubscribe", :id => "1" }
+      { :path => "/api/0.6/changeset/1/unsubscribe", :method => :post },
+      { :controller => "changeset", :action => "unsubscribe", :id => "1" }
     )
     assert_routing(
       { :path => "/api/0.6/changeset/1", :method => :put },
@@ -45,29 +45,25 @@ class ChangesetControllerTest < ActionController::TestCase
       { :controller => "changeset", :action => "close", :id => "1" }
     )
     assert_routing(
-        { :path => "/api/0.6/changeset/1/comment", :method => :post },
-        { :controller => "changeset", :action => "comment", :id => "1" }
+      { :path => "/api/0.6/changeset/1/comment", :method => :post },
+      { :controller => "changeset", :action => "comment", :id => "1" }
     )
     assert_routing(
-        { :path => "/api/0.6/changeset/comments/feed", :method => :get },
-        { :controller => "changeset", :action => "comments_feed", :format =>"rss" }
+      { :path => "/api/0.6/changeset/comment/1/hide", :method => :post },
+      { :controller => "changeset", :action => "hide_comment", :id => "1" }
     )
     assert_routing(
-        { :path => "/api/0.6/changeset/1/comments/feed", :method => :get },
-        { :controller => "changeset", :action => "comments_feed", :id => "1", :format =>"rss" }
-    )
-    assert_routing(
-        { :path => "/api/0.6/changeset/comment/1/hide", :method => :post },
-        { :controller => "changeset", :action => "hide_comment", :id => "1" }
-    )
-    assert_routing(
-        { :path => "/api/0.6/changeset/comment/1/unhide", :method => :post },
-        { :controller => "changeset", :action => "unhide_comment", :id => "1" }
+      { :path => "/api/0.6/changeset/comment/1/unhide", :method => :post },
+      { :controller => "changeset", :action => "unhide_comment", :id => "1" }
     )
     assert_routing(
       { :path => "/api/0.6/changesets", :method => :get },
       { :controller => "changeset", :action => "query" }
     )
+    assert_routing(
+      { :path => "/changeset/1/comments/feed", :method => :get },
+      { :controller => "changeset", :action => "comments_feed", :id => "1", :format =>"rss" }
+    )
     assert_routing(
       { :path => "/user/name/history", :method => :get },
       { :controller => "changeset", :action => "list", :display_name => "name" }
@@ -92,6 +88,10 @@ class ChangesetControllerTest < ActionController::TestCase
       { :path => "/history/feed", :method => :get },
       { :controller => "changeset", :action => "feed", :format => :atom }
     )
+    assert_routing(
+      { :path => "/history/comments/feed", :method => :get },
+      { :controller => "changeset", :action => "comments_feed", :format =>"rss" }
+    )
   end
 
   # -----------------------