]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/4996'
authorTom Hughes <tom@compton.nu>
Tue, 16 Jul 2024 16:15:47 +0000 (17:15 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 16 Jul 2024 16:15:47 +0000 (17:15 +0100)
app/views/diary_entries/show.html.erb
test/controllers/api/changeset_comments_controller_test.rb
test/controllers/api/changesets_controller_test.rb

index cfed1c46d401ff469015c6c9357bd7e1ac81b58e..e80a44f096005c1bdac773818bb4bc5472841feb 100644 (file)
@@ -21,7 +21,7 @@
         <% if @entry.subscribers.exists?(current_user.id) %>
           <%= link_to t(".unsubscribe"), diary_entry_unsubscribe_path(@entry.user, @entry), :method => :post, :class => "btn btn-sm btn-primary" %>
         <% else %>
-          <%= link_to t(".subscribe"), diary_entry_subscribe_path(@entry.user, @entry.id), :method => :post, :class => "btn btn-sm btn-primary" %>
+          <%= link_to t(".subscribe"), diary_entry_subscribe_path(@entry.user, @entry), :method => :post, :class => "btn btn-sm btn-primary" %>
         <% end %>
       </div>
     <% end %>
index e25926c78e41dfcf5bb691f268101256a83c3ce3..e7d8ca2095134abfbfc7ae43585633da8d1d615b 100644 (file)
@@ -225,21 +225,21 @@ module Api
       comment = create(:changeset_comment)
       assert comment.visible
 
-      post changeset_comment_hide_path(:id => comment)
+      post changeset_comment_hide_path(comment)
       assert_response :unauthorized
       assert comment.reload.visible
 
       auth_header = basic_authorization_header create(:user).email, "test"
 
       # not a moderator
-      post changeset_comment_hide_path(:id => comment), :headers => auth_header
+      post changeset_comment_hide_path(comment), :headers => auth_header
       assert_response :forbidden
       assert comment.reload.visible
 
       auth_header = basic_authorization_header create(:moderator_user).email, "test"
 
       # bad comment id
-      post changeset_comment_hide_path(:id => 999111), :headers => auth_header
+      post changeset_comment_hide_path(999111), :headers => auth_header
       assert_response :not_found
       assert comment.reload.visible
     end
@@ -252,7 +252,7 @@ module Api
 
       auth_header = basic_authorization_header create(:moderator_user).email, "test"
 
-      post changeset_comment_hide_path(:id => comment), :headers => auth_header
+      post changeset_comment_hide_path(comment), :headers => auth_header
       assert_response :success
       assert_not comment.reload.visible
     end
@@ -264,21 +264,21 @@ module Api
       comment = create(:changeset_comment, :visible => false)
       assert_not comment.visible
 
-      post changeset_comment_unhide_path(:id => comment)
+      post changeset_comment_unhide_path(comment)
       assert_response :unauthorized
       assert_not comment.reload.visible
 
       auth_header = basic_authorization_header create(:user).email, "test"
 
       # not a moderator
-      post changeset_comment_unhide_path(:id => comment), :headers => auth_header
+      post changeset_comment_unhide_path(comment), :headers => auth_header
       assert_response :forbidden
       assert_not comment.reload.visible
 
       auth_header = basic_authorization_header create(:moderator_user).email, "test"
 
       # bad comment id
-      post changeset_comment_unhide_path(:id => 999111), :headers => auth_header
+      post changeset_comment_unhide_path(999111), :headers => auth_header
       assert_response :not_found
       assert_not comment.reload.visible
     end
@@ -291,7 +291,7 @@ module Api
 
       auth_header = basic_authorization_header create(:moderator_user).email, "test"
 
-      post changeset_comment_unhide_path(:id => comment), :headers => auth_header
+      post changeset_comment_unhide_path(comment), :headers => auth_header
       assert_response :success
       assert comment.reload.visible
     end
index 17a9ad9d35ec901c289c6684ca2f94a839a33445..8bb22929444de2e8da30460c5b190544419cc8d9 100644 (file)
@@ -2592,7 +2592,7 @@ module Api
 
       # bad changeset id
       assert_no_difference "changeset.subscribers.count" do
-        post api_changeset_subscribe_path(:id => 999111), :headers => auth_header
+        post api_changeset_subscribe_path(999111), :headers => auth_header
       end
       assert_response :not_found