Sha256: d9e1962cbf4c0203eab2aac948497f2668165377023d5d5690542660e4a45668

Contents?: true

Size: 1.01 KB

Versions: 17

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

# 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(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 "should show 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

17 entries across 17 versions & 1 rubygems

Version Path
blacklight-5.19.2 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-5.19.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-5.19.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-5.18.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-5.17.2 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.0.0.pre5 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-5.17.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-5.17.0 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.0.0.pre4 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-5.16.4 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.0.0.pre3 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-5.16.3 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-5.16.2 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-5.16.1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.0.0.pre2 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-6.0.0.pre1 spec/views/catalog/_show_sidebar.erb_spec.rb
blacklight-5.16.0 spec/views/catalog/_show_sidebar.erb_spec.rb