Sha256: 03049130d3864d930a383ea6a62a1da67f2867e71dc7f77b3fcb37ec99f95d42

Contents?: true

Size: 947 Bytes

Versions: 36

Compression:

Stored size: 947 Bytes

Contents

# frozen_string_literal: true

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 "has the facet title" do
    allow(view).to receive(:render_facet_limit)
    render
    expect(rendered).to have_selector 'h3', text: "Facet title"
  end

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

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

Version data entries

36 entries across 36 versions & 1 rubygems

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