Sha256: 812357c864fe0bed04abfd69bd1ade4dcb5ffc219f3c53f642b632269b4d10d4
Contents?: true
Size: 734 Bytes
Versions: 36
Compression:
Stored size: 734 Bytes
Contents
# frozen_string_literal: true describe Blacklight::Solr::FacetPaginator do let(:f1) { Blacklight::Solr::Response::Facets::FacetItem.new(hits: '792', value: 'Book') } describe "#as_json" do subject { described_class.new([f1], offset: 0, limit: nil).as_json } it "should be well structured" do expect(subject).to eq("items" => [{"hits"=>"792", "value"=>"Book"}], "limit" => nil, "offset" => 0, "sort" => "index") end end describe '#sort' do it 'defaults to "count" if a limit is provided' do expect(described_class.new([], limit: 10).sort).to eq 'count' end it 'defaults to "index" if no limit is given' do expect(described_class.new([]).sort).to eq 'index' end end end
Version data entries
36 entries across 36 versions & 1 rubygems