Sha256: f51d3ec836c68dc7de43863a8ffd5ae371cf608224993e66ed6560d665a23d3a

Contents?: true

Size: 835 Bytes

Versions: 2

Compression:

Stored size: 835 Bytes

Contents

require 'spec_helper'

describe "catalog/_index_gallery.html.erb" do
  let(:blacklight_config) { Blacklight::Configuration.new }

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

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

  it "should have thumbnail and caption" do
    view.should_receive(:render_thumbnail_tag).with(document, {}, hash_including(:counter)).and_return('Thumbnail')
    view.should_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

2 entries across 2 versions & 1 rubygems

Version Path
blacklight-gallery-0.1.0 spec/views/catalog/_index_gallery.html.erb_spec.rb
blacklight-gallery-0.0.2 spec/views/catalog/_index_gallery.html.erb_spec.rb