Sha256: 94e5fcc1a50036755b4852be33008e55ba70ed52b1520efe071709c59b548462

Contents?: true

Size: 1.37 KB

Versions: 36

Compression:

Stored size: 1.37 KB

Contents

# frozen_string_literal: true

describe "catalog/_paginate_compact.html.erb" do
  let(:user) { User.new.tap { |u| u.save(validate: false) } }

  before do
    controller.request.path_parameters[:action] = 'index'
  end

  describe "with a real solr response", :integration => true do
    def blacklight_config
      @config ||= CatalogController.blacklight_config
    end

    def blacklight_config=(config)
      @config = config
    end

    def facet_limit_for *args
      0
    end

    include Blacklight::SearchHelper

    it "renders solr responses" do
      solr_response, document_list = search_results(q: '')
      render :partial => 'catalog/paginate_compact', :object => solr_response
      expect(rendered).to have_selector ".page_entries"
      expect(rendered).to have_selector "a[@rel=next]"
    end
  end

  it "renders paginatable arrays" do
    render :partial => 'catalog/paginate_compact', :object => (Kaminari.paginate_array([], total_count: 145).page(1).per(10))
    expect(rendered).to have_selector ".page_entries"
    expect(rendered).to have_selector "a[@rel=next]"
  end

  it "renders ActiveRecord collections" do
    50.times { b = Bookmark.new;  b.user = user; b.save! }
    render :partial => 'catalog/paginate_compact', :object => Bookmark.page(1).per(25)
    expect(rendered).to have_selector ".page_entries"
    expect(rendered).to have_selector "a[@rel=next]"
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
blacklight-6.25.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.24.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.23.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.22.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.21.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.20.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.19.2 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.19.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.19.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.18.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.17.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.16.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.15.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.14.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.14.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.13.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.12.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.11.2 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.11.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-6.11.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb