Sha256: b9e2c390ded7ba7e92dd5ccfed07b078ea1b48941f5fd0ee55ff5a32b52fde87

Contents?: true

Size: 959 Bytes

Versions: 46

Compression:

Stored size: 959 Bytes

Contents

require 'spec_helper'

describe 'catalog/facet.html.erb' do
  let(:display_facet) { double }
  let(:blacklight_config) { Blacklight::Configuration.new }
  before :each do
    blacklight_config.add_facet_field 'xyz', label: "Facet title"
    allow(view).to receive(:blacklight_config).and_return(blacklight_config)
    stub_template 'catalog/_facet_pagination.html.erb' => 'pagination'
    assign :facet, blacklight_config.facet_fields['xyz']
    assign :display_facet, display_facet
  end

  it "should have the facet title" do
    allow(view).to receive(:render_facet_limit)
    render
    expect(rendered).to have_selector 'h3', text: "Facet title"
  end

  it "should render facet pagination" do
    allow(view).to receive(:render_facet_limit)
    render
    expect(rendered).to have_content 'pagination'
  end

  it "should render the facet limit" do
    allow(view).to receive(:render_facet_limit).with(display_facet, layout: false)
    render
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

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