Sha256: e8fe90d52787f9681e35fcc8eb4eb4546e52710e19130c0caa8b1788467a57b1

Contents?: true

Size: 1004 Bytes

Versions: 42

Compression:

Stored size: 1004 Bytes

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'
    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

42 entries across 42 versions & 1 rubygems

Version Path
blacklight-7.14.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.14.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.13.2 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.13.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.13.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.12.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.12.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.11.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.10.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.9.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.8.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.8.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.7.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.6.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.5.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.5.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.4.2 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.4.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.4.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.3.0 spec/views/catalog/_show_sidebar.erb_spec.rb