From f1d5c666d6438a6f3269e847a130ebdc4e7b216c Mon Sep 17 00:00:00 2001 From: Takenori Takaki Date: Wed, 14 Oct 2026 14:03:32 +0900 Subject: [PATCH] Fix test failures and rubocop nit in watchers dialog pagination patch (#35192) --- app/controllers/watchers_controller.rb | 2 +- test/functional/watchers_controller_test.rb | 2 +- test/system/watchers_test.rb | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index 42e2cbfc00..0b1e5119c7 100644 --- a/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -201,7 +201,7 @@ class WatchersController < ApplicationController if @watchables.blank? || @watchables.all? {|w| w.valid_watcher?(user)} valid_users << user if valid_users.size == limit - has_more = has_more || (idx + 1 < batch.size) + has_more ||= (idx + 1 < batch.size) current_offset += (idx + 1) break end diff --git a/test/functional/watchers_controller_test.rb b/test/functional/watchers_controller_test.rb index 583373e1c2..5d870c75c4 100644 --- a/test/functional/watchers_controller_test.rb +++ b/test/functional/watchers_controller_test.rb @@ -210,7 +210,7 @@ class WatchersControllerTest < Redmine::ControllerTest assert_response :success assert_match( - %r{/watchers/autocomplete_for_user\?object_id%5B%5D=7&object_id%5B%5D=9&object_type=issue}, + %r{/watchers/autocomplete_for_user\?object_id%5B%5D=7&object_id%5B%5D=9&object_type=issue}, response.body ) end diff --git a/test/system/watchers_test.rb b/test/system/watchers_test.rb index b0a8795803..55782d8d38 100644 --- a/test/system/watchers_test.rb +++ b/test/system/watchers_test.rb @@ -94,6 +94,8 @@ class WatchersSystemTest < ApplicationSystemTestCase click_on 'Add' end + user1 = user2 = nil + within '#ajax-modal' do assert page.has_css?('p.watcher-more-users a', text: 'Show more') -- 2.30.0