From 1f4c298f764cce10c6875fbdce02fe853fa4e635 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Tue, 16 Jul 2024 17:32:00 +0300 Subject: [PATCH] Simplify subscribe path helper calls --- app/views/diary_entries/show.html.erb | 2 +- test/controllers/api/changesets_controller_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/diary_entries/show.html.erb b/app/views/diary_entries/show.html.erb index cfed1c46d..e80a44f09 100644 --- a/app/views/diary_entries/show.html.erb +++ b/app/views/diary_entries/show.html.erb @@ -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 %> <% end %> diff --git a/test/controllers/api/changesets_controller_test.rb b/test/controllers/api/changesets_controller_test.rb index 17a9ad9d3..8bb229294 100644 --- a/test/controllers/api/changesets_controller_test.rb +++ b/test/controllers/api/changesets_controller_test.rb @@ -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 -- 2.39.5