Sha256: b1fc5e6b64328cfbfa9bedacc8a79f1a681978f076828d76ffab74dcc1a6f37c

Contents?: true

Size: 1.43 KB

Versions: 47

Compression:

Stored size: 1.43 KB

Contents

describe 'spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb', type: :view do
  let(:p) { 'spotlight/sir_trevor/blocks/solr_documents_embed_block.html.erb' }
  let(:page) { double('Page') }
  let(:block) do
    SirTrevorRails::Blocks::SolrDocumentsEmbedBlock.new({ type: 'block', data: { title: 'Some title', text: 'Some text', 'text-align' => 'right' } }, page)
  end
  let(:doc) { blacklight_config.document_model.new(id: 1) }
  let(:blacklight_config) do
    Blacklight::Configuration.new do |config|
      config.view.embed.partials = %w(a b c)
      config.view.embed.locals = { a: 1 }
    end
  end

  before do
    allow(block).to receive(:each_document).and_yield({}, doc)
    allow(block).to receive(:documents?).and_return(true)
  end

  before do
    allow(view).to receive(:blacklight_config).and_return(blacklight_config)
    allow(view).to receive_messages(has_thumbnail?: true, render_thumbnail_tag: 'thumb')
  end

  it 'has a slideshow block' do
    expect(view).to receive(:render_document_partials).with(doc, %w(a b c), hash_including(a: 1, block: block)).and_return('OSD')
    render partial: p, locals: { solr_documents_embed_block: block }
    expect(rendered).to have_selector 'h3', text: 'Some title'
    expect(rendered).to have_content 'Some text'
    expect(rendered).to have_selector '.box', text: 'OSD'
    expect(rendered).to have_selector '.items-col.pull-left'
    expect(rendered).to have_selector '.text-col'
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
blacklight-spotlight-2.0.2 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-2.0.1 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-2.0.0 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc6 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc5 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc4 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc3 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc2 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc1 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-1.5.1 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-1.4.1 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-1.4.0 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-1.3.0 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-1.2.0 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-1.1.0 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-1.0.0 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-1.0.0.alpha2 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-1.0.0.alpha1 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-0.34.1 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
blacklight-spotlight-0.34.0 spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb