Sha256: fe6e2ebab7caf23180e7b0501a772d92a0f3bf7cdba1c6e7a60fb9bc36d23d7c
Contents?: true
Size: 773 Bytes
Versions: 30
Compression:
Stored size: 773 Bytes
Contents
# frozen_string_literal: true RSpec.describe Blacklight::Solr::FacetPaginator, api: true 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 "is 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
30 entries across 30 versions & 1 rubygems