Sha256: 0c8f751b234a19a74e5209eccc61e26a2f6ab26a744dc19b078cedf96982dca8

Contents?: true

Size: 1.06 KB

Versions: 14

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

# spec for sidebar partial in catalog show view

RSpec.describe "catalog/_show_sidebar.html.erb" do
  let(:blacklight_config) do
    Blacklight::Configuration.new do |config|
      config.index.title_field = 'title_tsim'
      config.index.sidebar_component = Blacklight::Document::SidebarComponent
    end
  end

  before do
    allow(view).to receive(:blacklight_config).and_return(blacklight_config)
    allow(view).to receive(:has_user_authentication_provider?).and_return(false)
    allow(view).to receive(:document_actions).and_return([])
    allow(view).to receive(:session_tracking_params).and_return({})
  end

  it "shows more-like-this titles in the sidebar" do
    document = SolrDocument.new id: 1, title_s: 'abc', format: 'default'
    allow(document).to receive(:more_like_this).and_return([SolrDocument.new('id' => '2', 'title_tsim' => 'Title of MLT Document')])
    render 'catalog/show_sidebar', document: document
    expect(rendered).to include("More Like This")
    expect(rendered).to include("Title of MLT Document")
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
blacklight-8.2.2 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-8.2.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-8.2.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-8.1.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-8.0.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-8.0.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-8.0.0.beta8 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-8.0.0.beta7 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-8.0.0.beta6 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-8.0.0.beta5 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-8.0.0.beta4 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-8.0.0.beta3 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-8.0.0.beta2 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-8.0.0.beta1 spec/views/catalog/_show_sidebar.erb_spec.rb