Sha256: 0d58cd801fa649db427ce63ed12d24ebd2f6cfe249a87892919f285f35e079dc

Contents?: true

Size: 663 Bytes

Versions: 44

Compression:

Stored size: 663 Bytes

Contents

# frozen_string_literal: true

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

  before do
    visit_component
  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

44 entries across 44 versions & 1 rubygems

Version Path
decidim-core-0.19.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.17.2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.18.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.17.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.16.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.17.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.16.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.15.2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.15.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.15.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.14.4 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.14.3 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.14.2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.14.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.13.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.12.2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.13.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.12.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.13.0.pre1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.12.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb