Skip to content

Commit 174165a

Browse files
Update SubGuideCard system spec to test for image
Co-authored-by: Anna Headley <[email protected]>
1 parent a824533 commit 174165a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<h1>SubGuideCards#show</h1>
22
<p>Find me in app/views/sub_guide_cards/show.html.erb</p>
33
<%= @sub_guide_card.heading %>
4-
<%= @sub_guide_card.path %>
54
<% @card_images.each do |image| %>
6-
<%= image_tag(image.iiif_url) %>
5+
<%= image_tag(image.iiif_url) %>
76
<% end %>

spec/system/subguide_cards_spec.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@
33
require 'rails_helper'
44
require 'ruby-progressbar/outputs/null'
55

6-
RSpec.describe 'GuideCards', type: :system, js: true do
6+
RSpec.describe 'SubGuideCards', type: :system, js: true do
77
let(:subguide_card_fixture) { Rails.root.join('spec', 'fixtures', 'subguide_card_fixture.csv') }
88
before do
99
SubGuideLoadingService.new(csv_location: subguide_card_fixture,
1010
progressbar: ProgressBar.create(output: ProgressBar::Outputs::Null)).import
1111
end
1212

13-
describe 'SubGuide page with image display' do
14-
it 'shows all images for the SubGuide path' do
13+
describe 'show page' do
14+
it 'displays card images as links' do
15+
ci = CardImage.new
16+
ci.path = SubGuideCard.find(2).path
17+
ci.image_name = 'imagecat-disk1-0675-B1764-0000.0219.tif'
18+
ci.save
1519
visit '/sub_guide_cards/2'
16-
expect(page).to have_text 'Afdeling natuurkunde'
20+
expect(page).to have_selector('img')
1721
end
1822
end
1923
end

0 commit comments

Comments
 (0)