Skip to content

Commit

Permalink
test for images URLs (#108)
Browse files Browse the repository at this point in the history
* test for images URLs
Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>

* Hardcode image url to start with

Co-authored-by: Bess Sadler <bess@users.noreply.github.com>
Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>

---------

Co-authored-by: Bess Sadler <bess@users.noreply.github.com>
Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 10, 2023
1 parent 7dcf726 commit 82902df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/sub_guide_card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ def parent
GuideCard.find_by(sortid: parentid) || SubGuideCard.find_by(sortid: parentid)
end
include HasChildren
def url
'https://puliiif.princeton.edu/iiif/2/imagecat-disk5-0338-A5977-0000.0073/full/,500/0/default.jpg'
end
end
14 changes: 14 additions & 0 deletions spec/models/sub_guide_card_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,18 @@
end
end
end

context 'when we use a card from disk5 with path 5/0338/A5977' do
it 'returns a URL' do
sub_guide_image = SubGuideCard.create(path: '5/0338/A5977')
expect(sub_guide_image.url).to eq 'https://puliiif.princeton.edu/iiif/2/imagecat-disk5-0338-A5977-0000.0073/full/,500/0/default.jpg'
end
end

context 'when we use a card from disk4 with path 4/1466/B5962' do
xit 'returns a URL' do
sub_guide_image = SubGuideCard.create(path: '4/1466/B5962')
expect(sub_guide_image.url).to eq 'https://puliiif.princeton.edu/iiif/2/imagecat-disk4-1466-B5962-0000.0064/full/,500/0/default.jpg'
end
end
end

0 comments on commit 82902df

Please sign in to comment.