Sha256: be13469ed36d6dc4116a65b789c5c84258f438472f3d65b51376bd3eb857d4e7

Contents?: true

Size: 963 Bytes

Versions: 4

Compression:

Stored size: 963 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
    expect(rendered).to include("More Like This")
    expect(rendered).to include("Title of MLT Document")
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blacklight-7.1.0.alpha spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.0.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.0.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-7.0.0.rc2 spec/views/catalog/_show_sidebar.erb_spec.rb