Sha256: c14cc1e85f828e8dbe048dc020d9e7b24f723dafa48695ef88dcc3c3ff097196

Contents?: true

Size: 675 Bytes

Versions: 31

Compression:

Stored size: 675 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

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

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
decidim-core-0.27.9 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.27.8 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.27.7 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.27.6 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.26.10 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.26.9 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.27.5 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.26.8 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.27.4 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.27.3 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.26.7 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.26.5 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.27.2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.27.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.26.4 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.27.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.26.3 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.27.0.rc2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.27.0.rc1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.26.2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb