Sha256: 90f326882faebd97a45a78b835cf31bdf5d62f707090f7512fb75cdfae8ff4f0

Contents?: true

Size: 1.3 KB

Versions: 26

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

describe "catalog/_paginate_compact.html.erb" do

  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 "should render solr responses" do
      solr_response, document_list = search_results({ q: '' }, CatalogController.search_params_logic)

      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 "should render 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 "should render ActiveRecord collections" do
    50.times { b = Bookmark.new;  b.user_id = 1; 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

26 entries across 26 versions & 1 rubygems

Version Path
blacklight-5.19.2 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.19.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.19.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.18.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.17.2 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.17.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.17.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.16.4 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.16.3 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.16.2 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.16.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.16.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.15.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.14.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.13.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.13.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.11.3 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.12.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.12.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.10.3 spec/views/catalog/_paginate_compact.html.erb_spec.rb