Sha256: d89c590f93eea1ab52d8cf76699f193874af3fe7a430943436c897d7568da74d

Contents?: true

Size: 989 Bytes

Versions: 5

Compression:

Stored size: 989 Bytes

Contents

# frozen_string_literal: true
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

5 entries across 5 versions & 1 rubygems

Version Path
blacklight-6.2.0 spec/views/catalog/facet.html.erb_spec.rb
blacklight-6.1.0 spec/views/catalog/facet.html.erb_spec.rb
blacklight-6.0.2 spec/views/catalog/facet.html.erb_spec.rb
blacklight-6.0.1 spec/views/catalog/facet.html.erb_spec.rb
blacklight-6.0.0 spec/views/catalog/facet.html.erb_spec.rb