Sha256: dc10df7bc1db7076bf850ac05859916124413da66db36fa3e1d072e9af1d0c8a

Contents?: true

Size: 913 Bytes

Versions: 14

Compression:

Stored size: 913 Bytes

Contents

# frozen_string_literal: true

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

  before do
    controller.request.path_parameters[:action] = 'index'
    allow(controller).to receive(:blacklight_config).and_return(blacklight_config)
  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_css ".page-entries"
    expect(rendered).to have_css "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_css ".page-entries"
    expect(rendered).to have_css "a[@rel=next]"
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
blacklight-8.8.4 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.8.3 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.8.2 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-9.0.0.beta1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.8.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.8.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.7.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.6.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.6.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.5.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.5.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.4.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.3.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb