From: nertc Date: Thu, 29 Aug 2024 13:07:05 +0000 (+0400) Subject: Test failures on issues pagination X-Git-Tag: live~272^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/52a28fbae807e54c4b02bf0026f028933381055d Test failures on issues pagination --- diff --git a/test/system/issues_test.rb b/test/system/issues_test.rb index ab2330e31..f00f766a2 100644 --- a/test/system/issues_test.rb +++ b/test/system/issues_test.rb @@ -163,8 +163,8 @@ class IssuesTest < ApplicationSystemTestCase end def test_issues_pagination - 1.upto(80).each do - user = create(:user) + 1.upto(80).each do |n| + user = create(:user, :display_name => "extra_#{n}") create(:issue, :reportable => user, :reported_user => user, :assigned_role => "administrator") end @@ -175,18 +175,33 @@ class IssuesTest < ApplicationSystemTestCase # First Page assert_no_content I18n.t("issues.page.user_not_found") assert_no_content I18n.t("issues.page.issues_not_found") - assert_css "tr", :count => 51 + 31.upto(80).each do |n| + assert_content(/extra_#{n}[^\d]/i, :count => 2) + end + 1.upto(30).each do |n| + assert_no_content(/extra_#{n}[^\d]/i) + end # Second Page click_on I18n.t("issues.page.older_issues") assert_no_content I18n.t("issues.page.user_not_found") assert_no_content I18n.t("issues.page.issues_not_found") - assert_css "tr", :count => 31 + 31.upto(80).each do |n| + assert_no_content(/extra_#{n}[^\d]/i) + end + 1.upto(30).each do |n| + assert_content(/extra_#{n}[^\d]/i, :count => 2) + end # Back to First Page click_on I18n.t("issues.page.newer_issues") assert_no_content I18n.t("issues.page.user_not_found") assert_no_content I18n.t("issues.page.issues_not_found") - assert_css "tr", :count => 51 + 31.upto(80).each do |n| + assert_content(/extra_#{n}[^\d]/i, :count => 2) + end + 1.upto(30).each do |n| + assert_no_content(/extra_#{n}[^\d]/i) + end end end