Project

General

Profile

Actions

Defect #36360

closed

IssuesSystemTest fails with ArgumentError in Ruby 3.1

Added by Go MAEDA almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Ruby support
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Error:
IssuesSystemTest#test_bulk_edit:
ArgumentError: wrong number of arguments (given 2, expected 0..1)
    test/system/issues_test.rb:401:in `test_bulk_edit'

rails test test/system/issues_test.rb:356
Error:
IssuesSystemTest#test_bulk_copy:
ArgumentError: wrong number of arguments (given 2, expected 0..1)
    test/system/issues_test.rb:465:in `test_bulk_copy'

rails test test/system/issues_test.rb:424
Error:
IssuesSystemTest#test_update_issue_status:
ArgumentError: wrong number of arguments (given 2, expected 0..1)
    test/system/issues_test.rb:228:in `block in <class:IssuesSystemTest>'

rails test test/system/issues_test.rb:223

Files

36360.patch (1.41 KB) 36360.patch Yuichi HARADA, 2021-12-27 06:42

Related issues

Related to Redmine - Feature #36205: Ruby 3.1 supportClosedGo MAEDA

Actions
Actions #1

Updated by Go MAEDA almost 3 years ago

Actions #2

Updated by Yuichi HARADA almost 3 years ago

I have confirmed. The following patch will solve this issue.

diff --git a/test/system/issues_test.rb b/test/system/issues_test.rb
index ab31a3e33b..f62949d39b 100644
--- a/test/system/issues_test.rb
+++ b/test/system/issues_test.rb
@@ -225,7 +225,7 @@ class IssuesSystemTest < ApplicationSystemTestCase
     log_user('jsmith', 'jsmith')
     visit "/issues/#{issue.id}" 
     page.first(:link, 'Edit').click
-    assert page.has_select?("issue_status_id", {:selected => "New"})
+    assert page.has_select?("issue_status_id", selected: "New")
     page.find("#issue_status_id").select("Closed")
     assert_no_difference 'Issue.count' do
       page.first(:button, 'Submit').click
@@ -398,7 +398,7 @@ class IssuesSystemTest < ApplicationSystemTestCase

     page.find('#issue_project_id').select('OnlineStore')
     # wait for ajax response
-    assert page.has_select?('issue_project_id', {:selected => 'OnlineStore'})
+    assert page.has_select?('issue_project_id', selected: 'OnlineStore')

     submit_buttons = page.all('input[type=submit]')
     assert_equal 2, submit_buttons.size
@@ -462,7 +462,7 @@ class IssuesSystemTest < ApplicationSystemTestCase

     page.find('#issue_project_id').select('OnlineStore')
     # wait for ajax response
-    assert page.has_select?('issue_project_id', {:selected => 'OnlineStore'})
+    assert page.has_select?('issue_project_id', selected: 'OnlineStore')

     submit_buttons = page.all('input[type=submit]')
     assert_equal 2, submit_buttons.size
Actions #3

Updated by Go MAEDA almost 3 years ago

  • Subject changed from System tests fail with Ruby 3.1 to IssuesSystemTest fails with ArgumentError in Ruby 3.1
  • Category set to Ruby support
  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix as a part of #36205. Thank you.

Actions

Also available in: Atom PDF