Actions
Patch #44115
openGroupsController#remove_users tests fail randomly
Status:
New
Priority:
Normal
Assignee:
-
Category:
Code cleanup/refactoring
Target version:
-
Description
GroupsController#remove_users tests fail randomly.
The controller action generates the expected `params[:confirm]` value based on the user's locale, while `I18n.t(:general_text_Yes)` in the test code can be affected by locale changes made by other tests.
For example, the following execution may fail:
$ ./bin/rails test test/unit/mailer_test.rb:1083 test/functional/groups_controller_test.rb:288 --seed 38437 Run options: --seed 38437 # Running: .F Failure: GroupsControllerTest#test_remove_users_plural [test/functional/groups_controller_test.rb:288]: `group.users.count` didn't change by -2, but by 0. Expected: 0 Actual: 2 bin/rails test test/functional/groups_controller_test.rb:285 Finished in 1.634871s, 1.2233 runs/s, 3.0583 assertions/s. 2 runs, 5 assertions, 1 failures, 0 errors, 0 skips
This patch fixes the flaky tests by explicitly setting the locale before running the tests.
Files
No data to display
Actions