Sha256: cc388a08996066aacbd883b2b98f9ee498ed9ddfd8d9591e1b1c4141ee6687cf

Contents?: true

Size: 958 Bytes

Versions: 5

Compression:

Stored size: 958 Bytes

Contents

require 'spec_helper'

describe "catalog/_index_gallery.html.erb", :type => :view do
  let(:blacklight_config) { Blacklight::Configuration.new }

  let(:document) { stub_model(::SolrDocument) }

  before do
    blacklight_config.view.gallery.partials = ['a', 'b']
    allow(view).to receive_messages(blacklight_config: blacklight_config)
    allow(view).to receive_messages(document: document)
    allow(view).to receive_messages(document_counter: 3, document_counter_with_offset: 3)
  end

  it "should have thumbnail and caption" do
    expect(view).to receive(:render_thumbnail_tag).with(document, { class: 'img-thumbnail', alt: '' }, hash_including(:counter)).and_return('Thumbnail')
    expect(view).to receive(:render_document_partials).with(document, ['a', 'b'], document_counter: 3).and_return('Z')
    render
    expect(rendered).to have_selector '.thumbnail', text: 'Thumbnail'
    expect(rendered).to have_selector '.caption', text: 'Z'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
blacklight-gallery-2.1.0 spec/views/catalog/_index_gallery.html.erb_spec.rb
blacklight-gallery-2.0.2 spec/views/catalog/_index_gallery.html.erb_spec.rb
blacklight-gallery-2.0.1 spec/views/catalog/_index_gallery.html.erb_spec.rb
blacklight-gallery-2.0.0 spec/views/catalog/_index_gallery.html.erb_spec.rb
blacklight-gallery-1.7.0 spec/views/catalog/_index_gallery.html.erb_spec.rb