Sha256: d8382112642236bd5c5aa15abcb41c946dbeebc80e2b70de1eca19ab88813248

Contents?: true

Size: 989 Bytes

Versions: 19

Compression:

Stored size: 989 Bytes

Contents

# frozen_string_literal: true

describe 'spotlight/search_configurations/_facet_metadata', type: :view do
  before do
    render partial: 'spotlight/search_configurations/facet_metadata', locals: { metadata: metadata }
  end

  context 'with a facet without any documents' do
    let(:metadata) { { document_count: 0 } }

    it 'shows there are no documents' do
      expect(rendered).to have_content '0 items'
    end
  end

  context 'with a facet with a small number of values' do
    let(:metadata) { { document_count: 1, value_count: 3, terms: %w[a b c] } }

    it 'shows the number of unique values' do
      expect(rendered).to have_content '1 item'
      expect(rendered).to have_content '3 unique values'
    end
  end

  context 'with a facet with a large number of values' do
    let(:metadata) { { document_count: 1, value_count: 21, terms: %w[] } }

    it 'shows there are many unique values' do
      expect(rendered).to have_content '20+ unique values'
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
blacklight-spotlight-3.2.0 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.1.0 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.3 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.2 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.1 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc6 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc5 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc4 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc3 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc2 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc1 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.10 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.9 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.8 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.7 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.6 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.5 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.4 spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb