Sha256: dddbe4f713a7e87efa50201a44678b6b97c9b9e7d3a87a37c04b32398d1a93cf
Contents?: true
Size: 946 Bytes
Versions: 15
Compression:
Stored size: 946 Bytes
Contents
describe 'spotlight/browse/search', type: :view do let(:search) { FactoryBot.create(:search) } let(:exhibit) { FactoryBot.create(:exhibit) } before do allow(search).to receive_messages(documents: double(size: 15)) allow(search).to receive_message_chain(:thumbnail, iiif_url: '/some/image') end before do assign :exhibit, exhibit end it 'displays the image' do render partial: 'spotlight/browse/search', locals: { search: search } expect(response).to have_selector 'a img[src="/some/image"]' end it 'has a heading' do render partial: 'spotlight/browse/search', locals: { search: search } expect(response).to have_link search.title, href: spotlight.exhibit_browse_path(exhibit, search) end it 'displays the item count' do render partial: 'spotlight/browse/search', locals: { search: search } expect(response).to have_selector 'small', text: /#{search.documents.size} items/i end end
Version data entries
15 entries across 15 versions & 1 rubygems