Sha256: a1390adf0f7dd9933720a85d0175c5b92b3360f164f1de444f827ce0e58bcbd0

Contents?: true

Size: 1.08 KB

Versions: 36

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

# spec for sidebar partial in catalog show view

describe "/catalog/_show_sidebar.html.erb" do

  let(:blacklight_config) do
    Blacklight::Configuration.new do |config|
      config.index.title_field = 'title_display'
    end
  end

  before(:each) do
    allow(controller).to receive(:action_name).and_return('show')
    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(:current_search_session).and_return nil
    allow(view).to receive(:search_session).and_return({})
    allow(view).to receive(:document_actions).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_display' => '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

36 entries across 36 versions & 1 rubygems

Version Path
blacklight-6.25.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.24.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.23.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.22.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.21.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.20.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.19.2 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.19.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.19.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.18.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.17.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.16.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.15.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.14.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.14.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.13.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.12.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.11.2 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.11.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.11.0 spec/views/catalog/_show_sidebar.erb_spec.rb