spec/models/spotlight/page_spec.rb in blacklight-spotlight-0.32.0 vs spec/models/spotlight/page_spec.rb in blacklight-spotlight-0.33.0
- old
+ new
@@ -91,6 +91,20 @@
it 'gets a default slug' do
expect(page.slug).to eq 'xyz'
end
end
end
+
+ describe 'thumbnail_image_url' do
+ subject(:thumbnail) { FactoryGirl.create(:featured_image) }
+ subject(:page) { FactoryGirl.create(:feature_page, exhibit: exhibit) }
+
+ it 'is nil when there is no thumbnail' do
+ expect(page.thumbnail_image_url).to be_nil
+ end
+
+ it "is returns the thumbnail's IIIF url" do
+ page.thumbnail = thumbnail
+ expect(page.thumbnail_image_url).to eq thumbnail.iiif_url
+ end
+ end
end