Sha256: 9bbb8eaa6bb9a53685313f6876bb74992803a931982ab90c827eb25c371663e3
Contents?: true
Size: 635 Bytes
Versions: 7
Compression:
Stored size: 635 Bytes
Contents
module Features module Pagination def paginates(factory:, increment:, selector:, attributes:{}) factory_string = factory.to_s factory = factory_string.underscore.to_sym factory_plural = factory_string.pluralize.underscore.to_sym number_of_results_for_two_pages = increment + 1 results = FactoryGirl. create_list(factory, number_of_results_for_two_pages, attributes) yield expect(page).to have_selector(selector, count: increment) click_on('Next') expect(page).to have_selector(selector, count: 1) end end end
Version data entries
7 entries across 7 versions & 1 rubygems