Error:
CustomFieldsGroupTest#test_should_require_name:
TypeError: no implicit conversion of String into Hash
plugins/redmine_custom_fields_groups/test/unit/custom_fields_group_test.rb:2[3](https://github.com/gtt-project/redmine_custom_fields_groups/actions/runs/9345503703/job/25718467637#step:7:3):in `block in <class:CustomFieldsGroupTest>'
rails test plugins/redmine_custom_fields_groups/test/unit/custom_fields_group_test.rb:20
:
Error:
CustomFieldsGroupTest#test_should_validate_name_uniqueness:
TypeError: no implicit conversion of String into Hash
plugins/redmine_custom_fields_groups/test/unit/custom_fields_group_test.rb:38:in `block (2 levels) in <class:CustomFieldsGroupTest>'
plugins/redmine_custom_fields_groups/test/unit/custom_fields_group_test.rb:3[4](https://github.com/gtt-project/redmine_custom_fields_groups/actions/runs/9345503703/job/25718467637#step:7:4):in `block in <class:CustomFieldsGroupTest>'
rails test plugins/redmine_custom_fields_groups/test/unit/custom_fields_group_test.rb:26
test 'should require name' do
custom_fields_group = CustomFieldsGroup.new
assert_not custom_fields_group.save
assert custom_fields_group.errors[:name]
end
test 'should validate name uniqueness' do
assert_difference 'CustomFieldsGroup.count' do
custom_fields_group = CustomFieldsGroup.new
custom_fields_group.name = 'test'
assert custom_fields_group.save
assert_equal 'test', custom_fields_group.name
end
assert_no_difference 'CustomFieldsGroup.count' do
custom_fields_group = CustomFieldsGroup.new
custom_fields_group.name = 'test'
assert_not custom_fields_group.save
assert custom_fields_group.errors[:name]
end
end
Expectation
The errors should not happen from any repository PR.
Problem Currently, automatic Weblate translation PR CI is failing. Jobs: https://github.com/gtt-project/redmine_custom_fields_groups/actions/runs/9345503703
https://github.com/gtt-project/redmine_custom_fields_groups/actions/runs/9345503703/job/25718463297#step:7:1
https://github.com/gtt-project/redmine_custom_fields_groups/actions/runs/9345503703/job/25718467637#step:7:1
To Reproduce I am not sure why this unit test error is happen, but the errors happen same place, and I guess that
custom_fields_group.errors[:name]
causes the errors. https://github.com/gtt-project/redmine_custom_fields_groups/blob/next/test/unit/custom_fields_group_test.rb#L20-L40Expectation The errors should not happen from any repository PR.