Sha256: 97446920b9b46433bb7cbfe6ba282fb83fb5854201dce478e43ab9d0f594fa90

Contents?: true

Size: 1.09 KB

Versions: 16

Compression:

Stored size: 1.09 KB

Contents

# Note: this is a direct copy of the corresponding test in Blacklight
# with changes for "views/my" instead of "views/catalog"

describe "my/facet.html.erb", type: :view do
  let(:display_facet) { double }
  let(:blacklight_config) { Blacklight::Configuration.new }
  before do
    blacklight_config.add_facet_field "xyz", label: "Facet title"
    allow(view).to receive(:blacklight_config).and_return(blacklight_config)
    allow(view).to receive(:blacklight_config).and_return(blacklight_config)
    stub_template "my/_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
    expect(view).to receive(:render_facet_limit).with(display_facet, layout: false)
    render
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sufia-7.4.1 spec/views/my/facet.html.erb_spec.rb
sufia-7.4.0 spec/views/my/facet.html.erb_spec.rb
sufia-7.3.1 spec/views/my/facet.html.erb_spec.rb
sufia-7.3.0 spec/views/my/facet.html.erb_spec.rb
sufia-7.3.0.rc3 spec/views/my/facet.html.erb_spec.rb
sufia-7.3.0.rc2 spec/views/my/facet.html.erb_spec.rb
sufia-7.3.0.rc1 spec/views/my/facet.html.erb_spec.rb
sufia-7.2.0 spec/views/my/facet.html.erb_spec.rb
sufia-7.1.0 spec/views/my/facet.html.erb_spec.rb
sufia-7.0.0 spec/views/my/facet.html.erb_spec.rb
sufia-7.0.0.rc2 spec/views/my/facet.html.erb_spec.rb
sufia-7.0.0.rc1 spec/views/my/facet.html.erb_spec.rb
sufia-7.0.0.beta4 spec/views/my/facet.html.erb_spec.rb
sufia-7.0.0.beta3 spec/views/my/facet.html.erb_spec.rb
sufia-7.0.0.beta2 spec/views/my/facet.html.erb_spec.rb
sufia-7.0.0.beta1 spec/views/my/facet.html.erb_spec.rb