Sha256: 0a2cd1e5146637e8f0d7ee91588b02eac75e72108a279bae9b000a79fe9885de

Contents?: true

Size: 949 Bytes

Versions: 7

Compression:

Stored size: 949 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' }, 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

7 entries across 7 versions & 1 rubygems

Version Path
blacklight-gallery-1.6.0 spec/views/catalog/_index_gallery.html.erb_spec.rb
blacklight-gallery-1.5.0 spec/views/catalog/_index_gallery.html.erb_spec.rb
blacklight-gallery-1.4.0 spec/views/catalog/_index_gallery.html.erb_spec.rb
blacklight-gallery-1.3.0 spec/views/catalog/_index_gallery.html.erb_spec.rb
blacklight-gallery-1.2.1 spec/views/catalog/_index_gallery.html.erb_spec.rb
blacklight-gallery-1.2.0 spec/views/catalog/_index_gallery.html.erb_spec.rb
blacklight-gallery-1.1.1 spec/views/catalog/_index_gallery.html.erb_spec.rb