diff --git a/app/models/card_image.rb b/app/models/card_image.rb
index c66c0cfc..6f339067 100644
--- a/app/models/card_image.rb
+++ b/app/models/card_image.rb
@@ -6,4 +6,8 @@ class CardImage < ApplicationRecord
def iiif_url
"https://puliiif.princeton.edu/iiif/2/#{image_name.gsub('.tif', '')}/full/,500/0/default.jpg"
end
+
+ def iiif_max_url
+ "https://puliiif.princeton.edu/iiif/2/#{image_name.gsub('.tif', '')}/full/max/0/default.jpg"
+ end
end
diff --git a/app/views/shared/_card_image_list.html.erb b/app/views/shared/_card_image_list.html.erb
index 81baa89d..96974bbf 100644
--- a/app/views/shared/_card_image_list.html.erb
+++ b/app/views/shared/_card_image_list.html.erb
@@ -7,7 +7,7 @@
i = index + 1
number = ((p - 1) * 10) + i %>
<%= "Card #{number} of #{@total_cards}" %>
- <%= image_tag(image.iiif_url, alt: "Catalog Card") %>
+ <%= link_to image_tag(image.iiif_url, alt: "Catalog Card"), image.iiif_max_url %>
<% end %>
diff --git a/spec/models/card_image_spec.rb b/spec/models/card_image_spec.rb
index 5609c831..96eaad62 100644
--- a/spec/models/card_image_spec.rb
+++ b/spec/models/card_image_spec.rb
@@ -15,5 +15,6 @@
ci.image_name = 'imagecat-disk1-0675-B1764-0000.0219.tif'
ci.save
expect(ci.iiif_url).to eq 'https://puliiif.princeton.edu/iiif/2/imagecat-disk1-0675-B1764-0000.0219/full/,500/0/default.jpg'
+ expect(ci.iiif_max_url).to eq 'https://puliiif.princeton.edu/iiif/2/imagecat-disk1-0675-B1764-0000.0219/full/max/0/default.jpg'
end
end
diff --git a/spec/system/guide_cards_spec.rb b/spec/system/guide_cards_spec.rb
index 26aecadd..605abd2c 100644
--- a/spec/system/guide_cards_spec.rb
+++ b/spec/system/guide_cards_spec.rb
@@ -31,14 +31,14 @@
end
describe 'show page' do
- it 'displays card images' do
- ci = CardImage.new
- ci.path = GuideCard.find(2).path
- ci.image_name = 'imagecat-disk1-0675-B1764-0000.0219.tif'
- ci.save
+ it 'displays card images as links' do
+ CardImage.create(
+ path: GuideCard.find(2).path,
+ image_name: 'imagecat-disk1-0675-B1764-0000.0219.tif'
+ )
visit '/guide_cards/2'
- expect(page).to have_selector('img')
- expect(page).to have_selector('img[alt]')
+ max_url = 'https://puliiif.princeton.edu/iiif/2/imagecat-disk1-0675-B1764-0000.0219/full/max/0/default.jpg'
+ expect(page).to have_selector("a[href=\"#{max_url}\"] img[alt]")
end
end
diff --git a/spec/views/guide_cards/index.html.erb_spec.rb b/spec/views/guide_cards/index.html.erb_spec.rb
deleted file mode 100644
index 1fd373a6..00000000
--- a/spec/views/guide_cards/index.html.erb_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-require 'rails_helper'
-
-RSpec.describe 'guide_cards/index.html.erb', type: :view do
- pending "add some examples to (or delete) #{__FILE__}"
-end
diff --git a/spec/views/guide_cards/show.html.erb_spec.rb b/spec/views/guide_cards/show.html.erb_spec.rb
deleted file mode 100644
index 7864cbb5..00000000
--- a/spec/views/guide_cards/show.html.erb_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-require 'rails_helper'
-
-RSpec.describe 'guide_cards/show.html.erb', type: :view do
- pending "add some examples to (or delete) #{__FILE__}"
-end
diff --git a/spec/views/sub_guide_cards/index.html.erb_spec.rb b/spec/views/sub_guide_cards/index.html.erb_spec.rb
deleted file mode 100644
index 269e243a..00000000
--- a/spec/views/sub_guide_cards/index.html.erb_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-require 'rails_helper'
-
-RSpec.describe 'sub_guide_cards/index.html.erb', type: :view do
- pending "add some examples to (or delete) #{__FILE__}"
-end
diff --git a/spec/views/sub_guide_cards/show.html.erb_spec.rb b/spec/views/sub_guide_cards/show.html.erb_spec.rb
deleted file mode 100644
index 74f8705c..00000000
--- a/spec/views/sub_guide_cards/show.html.erb_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-require 'rails_helper'
-
-RSpec.describe 'sub_guide_cards/show.html.erb', type: :view do
- pending "add some examples to (or delete) #{__FILE__}"
-end
diff --git a/spec/views/welcome/index.html.erb_spec.rb b/spec/views/welcome/index.html.erb_spec.rb
deleted file mode 100644
index 0718a25f..00000000
--- a/spec/views/welcome/index.html.erb_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-require 'rails_helper'
-
-RSpec.describe 'welcome/index.html.erb', type: :view do
- pending "add some examples to (or delete) #{__FILE__}"
-end