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

Version Path
blacklight-spotlight-2.0.2 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-2.0.1 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-2.0.0 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc6 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc5 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc4 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc3 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc2 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc1 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-1.5.1 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-1.4.1 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-1.4.0 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-1.3.0 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-1.2.0 spec/views/spotlight/browse/_search.html.erb_spec.rb
blacklight-spotlight-1.1.0 spec/views/spotlight/browse/_search.html.erb_spec.rb