From ac2d415797af922400475dda57924fe7e5859a90 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 11 Oct 2026 19:53:48 +1300 Subject: [PATCH] Fix breadcrumb links to point to the correct garden path in views and update specs --- app/views/garden_collaborators/index.html.haml | 2 +- app/views/gardens/show.html.haml | 2 +- spec/views/gardens/show.html.haml_spec.rb | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/garden_collaborators/index.html.haml b/app/views/garden_collaborators/index.html.haml index fd1d01996..95bab6a68 100644 --- a/app/views/garden_collaborators/index.html.haml +++ b/app/views/garden_collaborators/index.html.haml @@ -4,7 +4,7 @@ - content_for :breadcrumbs do %li.breadcrumb-item= link_to 'Gardens', gardens_path - %li.breadcrumb-item.active= link_to @garden, gardens_path(@garden) + %li.breadcrumb-item.active= link_to @garden, garden_path(@garden) .row .col-md-2 diff --git a/app/views/gardens/show.html.haml b/app/views/gardens/show.html.haml index fa48c4038..37eb60d31 100644 --- a/app/views/gardens/show.html.haml +++ b/app/views/gardens/show.html.haml @@ -11,7 +11,7 @@ - content_for :breadcrumbs do %li.breadcrumb-item= link_to 'Gardens', gardens_path - %li.breadcrumb-item.active= link_to @garden.name, gardens_path(@garden) + %li.breadcrumb-item.active= link_to @garden.name, garden_path(@garden) .row .col-md-9.col-12 diff --git a/spec/views/gardens/show.html.haml_spec.rb b/spec/views/gardens/show.html.haml_spec.rb index 058664a8d..a35788d3a 100644 --- a/spec/views/gardens/show.html.haml_spec.rb +++ b/spec/views/gardens/show.html.haml_spec.rb @@ -21,6 +21,10 @@ describe "gardens/show" do expect(rendered).to have_content @garden.location end + it 'links the breadcrumb to the garden itself' do + expect(view.content_for(:breadcrumbs)).to have_link(@garden.name, href: garden_path(@garden)) + end + it 'shows the area' do expect(rendered).to have_content pluralize(@garden.area, @garden.area_unit) end