Sha256: 704955e16f9ff9be32a8236a1d93e69b579f51b6df0b92106db8ae65d91d30b7

Contents?: true

Size: 661 Bytes

Versions: 38

Compression:

Stored size: 661 Bytes

Contents

# frozen_string_literal: true

shared_examples "a paginated resource" do
  let(:collection_size) { 30 }

  before do
    visit_feature
  end

  it "lists 20 resources per page by default" do
    expect(page).to have_css(resource_selector, count: 20)
    expect(page).to have_css(".pagination .page", count: 2)
  end

  it "results per page can be changed from the selector" do
    expect(page).to have_css(".results-per-page")

    within ".results-per-page" do
      page.find("a", text: "20").click
      click_link "50"
    end

    expect(page).to have_css(resource_selector, count: collection_size)
    expect(page).to have_no_css(".pagination")
  end
end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
decidim-core-0.10.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.10.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.9.3 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.9.2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.9.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.9.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.8.4 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.8.3 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.8.2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.8.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.8.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.7.4 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.7.3 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.7.2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.7.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.7.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.6.8 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-0.6.8 decidim-core/lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.6.7 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-0.6.7 decidim-core/lib/decidim/core/test/shared_examples/paginated_resource_examples.rb