Sha256: e0eefa4113ddf69a6634b7e530cdbcb1f412111a2714bfacdc3605d2c9a4e84c

Contents?: true

Size: 1.26 KB

Versions: 28

Compression:

Stored size: 1.26 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::SolrHelper

    it "should render solr responses" do
      solr_response, document_list = get_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 "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

28 entries across 28 versions & 1 rubygems

Version Path
blacklight-5.9.4 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.9.3 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.9.2 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.9.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.9.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.8.2 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.8.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.8.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.7.2 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.5.4 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.7.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.7.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.6.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.5.3 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.5.2 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.5.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.5.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.4.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.4.0.rc1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-5.3.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb