Failing spec is ./spec/controllers/work_package_relations_controller_spec.rb:133
on job run https://github.com/opf/openproject/actions/runs/14646323170/job/41101314595
Reproduction command:
rspec './spec/controllers/work_package_relations_controller_spec.rb[1:4:1,1:5:2]' --seed 37278
The `relation` instance is destroyed in a test, and reloaded for the
next test as we are using `shared_let`. But when reloading a destroyed
record, it remains destroyed. When updating it, it tries to save it
again, including the related work packages but they already exist in
database. This leads to the error "ActiveRecord::RecordInvalid:
Validation failed: Related work package has already been taken.".
To fix this, we use `refind: true` to reload the relation using a
database `find`.
https://community.openproject.org/wp/63521
No need to delete something that does not exist anymore. This can happen
when the same relation is deleted in two different browser tabs.
The mediator is responsible for providing the relations and children
from a work package for the relations tab. This moves the responsibility
of relations and children visibility in one central place.
* Create `new` controller action and tests to render modal with form.
* Render new relation form with tests.
* Plug in create service and form fields required for creating
a relation with tests.
* Make description settable with tests.