Sha256: 24014a72bb9da3e4aa6bbb5d96838f622313e92de33ea9cc82fb32a0cba7f005

Contents?: true

Size: 916 Bytes

Versions: 8

Compression:

Stored size: 916 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"
    view.stub(: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
    view.stub(:render_facet_limit)
    render
    expect(rendered).to have_selector 'h3', text: "Facet title"
  end

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

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
blacklight-5.5.1 spec/views/catalog/facet.html.erb_spec.rb
blacklight-5.5.0 spec/views/catalog/facet.html.erb_spec.rb
blacklight-5.4.0 spec/views/catalog/facet.html.erb_spec.rb
blacklight-5.4.0.rc1 spec/views/catalog/facet.html.erb_spec.rb
blacklight-5.3.0 spec/views/catalog/facet.html.erb_spec.rb
blacklight-5.1.1 spec/views/catalog/facet.html.erb_spec.rb
blacklight-5.2.0 spec/views/catalog/facet.html.erb_spec.rb
blacklight-5.1.0 spec/views/catalog/facet.html.erb_spec.rb