From ac132425ce31c4952105412efdb20df72e8999f0 Mon Sep 17 00:00:00 2001 From: leefaisonr Date: Fri, 25 Aug 2023 09:54:10 -0400 Subject: [PATCH] Add links to children of SubGuideCards closes #132 Co-authored-by: Anna Headley --- app/views/sub_guide_cards/show.html.erb | 11 ++++++++--- spec/system/subguide_cards_spec.rb | 7 ++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/views/sub_guide_cards/show.html.erb b/app/views/sub_guide_cards/show.html.erb index ad53ec5..0956828 100644 --- a/app/views/sub_guide_cards/show.html.erb +++ b/app/views/sub_guide_cards/show.html.erb @@ -1,6 +1,11 @@ -

SubGuideCards#show

-

Find me in app/views/sub_guide_cards/show.html.erb

-<%= @sub_guide_card.heading %> +

SubGuide: <%= @sub_guide_card.heading %>

+<% if @sub_guide_card.children.present? %> + +<% end %> <% @card_images.each do |image| %> <%= image_tag(image.iiif_url) %> <% end %> \ No newline at end of file diff --git a/spec/system/subguide_cards_spec.rb b/spec/system/subguide_cards_spec.rb index 856eca2..e9cfb0a 100644 --- a/spec/system/subguide_cards_spec.rb +++ b/spec/system/subguide_cards_spec.rb @@ -11,7 +11,7 @@ end describe 'show page' do - it 'displays card images as links' do + it 'displays card images' do ci = CardImage.new ci.path = SubGuideCard.find(2).path ci.image_name = 'imagecat-disk1-0675-B1764-0000.0219.tif' @@ -19,5 +19,10 @@ visit '/sub_guide_cards/2' expect(page).to have_selector('img') end + + it 'links to child SubGuideCards' do + visit '/sub_guide_cards/4' + expect(page).to have_link('(As author)') + end end end