From 027c006bba444971f1a4e8c8d44d54fbcc5be27e Mon Sep 17 00:00:00 2001 From: Mir Bhatia Date: Wed, 1 Apr 2026 09:27:51 +0200 Subject: [PATCH] Fix link --- app/views/news/show.html.erb | 2 +- spec/controllers/news_controller_spec.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/news/show.html.erb b/app/views/news/show.html.erb index 701412bedb5..0c69446543c 100644 --- a/app/views/news/show.html.erb +++ b/app/views/news/show.html.erb @@ -47,7 +47,7 @@ See COPYRIGHT and LICENSE files for more details. mobile_icon: :pencil, mobile_label: t(:button_edit), size: :medium, - href: edit_project_news_path(@news), + href: edit_project_news_path(@project, @news), aria: { label: I18n.t(:button_edit) }, title: I18n.t(:button_edit) ) do |button| diff --git a/spec/controllers/news_controller_spec.rb b/spec/controllers/news_controller_spec.rb index c4d262c6d81..d474bb9dfcb 100644 --- a/spec/controllers/news_controller_spec.rb +++ b/spec/controllers/news_controller_spec.rb @@ -103,6 +103,12 @@ RSpec.describe NewsController do expect(response).to be_not_found end + + it "renders edit link with correct project identifier" do + get :show, params: { project_id: news.project_id, id: news.id } + + expect(response.body).to include edit_project_news_path(project, news) + end end end