Sha256: 276f4ffa48739d45a916ecdc78dfbfc1ae61a62baffce767172e3623c267a897

Contents?: true

Size: 1.17 KB

Versions: 23

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

describe "catalog/_document_masonry.html.erb", :type => :view do
  let(:blacklight_config) { Blacklight::Configuration.new }
  let(:documents) { [stub_model(::SolrDocument), stub_model(::SolrDocument)] }
  before do
    allow(view).to receive_messages(blacklight_config: blacklight_config)
    allow(view).to receive_messages(documents: documents)
    allow(view).to receive_messages(document_counter: 1)
    allow(view).to receive_messages(document_counter_with_offset: 1)
    allow(view).to receive_messages(render_document_partials: "Caption")
    allow(view).to receive_messages(render_thumbnail_tag: "Thumbnail")
    render
  end

  it 'should render a container div with a data attribute to initiate the masonry plugin' do
    expect(rendered).to have_css('#documents[data-behavior="masonry-gallery"]')
  end

  it 'should render a .masonry.document div for each document' do
    expect(rendered).to have_css('.masonry.document', count: 2)
  end

  it 'should render the thumbnail' do
    expect(rendered).to have_css('.thumbnail', text: 'Thumbnail')
  end

  it 'should render the caption' do
    expect(rendered).to have_css('.caption', text: 'Caption')
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
blacklight-gallery-1.6.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-1.5.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-1.4.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-1.3.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-1.2.1 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-1.2.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-1.1.1 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-1.1.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-0.12.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-1.0.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-0.11.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-0.10.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-0.9.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-0.8.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-0.7.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-0.6.1 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-0.6.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-0.4.1 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-0.5.0 spec/views/catalog/_index_masonry.html.erb_spec.rb
blacklight-gallery-0.4.0 spec/views/catalog/_index_masonry.html.erb_spec.rb