Replace link with button in Topics show

This commit is contained in:
cyrillefr
2025-04-22 08:35:52 +02:00
parent 50076504b5
commit 3eba2d27a4
2 changed files with 5 additions and 5 deletions

View File

@@ -32,7 +32,7 @@
edit_community_topic_path(@community.id, @topic), edit_community_topic_path(@community.id, @topic),
class: "button hollow expanded" %> class: "button hollow expanded" %>
<%= link_to t("community.show.topic.destroy"), <%= button_to t("community.show.topic.destroy"),
community_topic_path(@community.id, @topic), community_topic_path(@community.id, @topic),
method: :delete, method: :delete,
class: "button hollow expanded alert" %> class: "button hollow expanded alert" %>

View File

@@ -131,7 +131,7 @@ describe "Topics" do
login_as(user) login_as(user)
visit community_topic_path(topic.community, topic) visit community_topic_path(topic.community, topic)
click_link "Delete topic" click_button "Delete topic"
expect(page).to have_content "Topic deleted successfully." expect(page).to have_content "Topic deleted successfully."
expect(page).not_to have_content topic.title expect(page).not_to have_content topic.title