From the deleted work package, its parent, its successors, and the
successors of its descendants are rescheduled and switched to manual
scheduling if appropriate.
PR #13897 did a great job at improving the performance of running
`work_packages/update_ancestors_service_spec` spec by making it 70%
faster.
With some additional `shared_let`, it's possible to have less work
packages created and gain a little 20% more.
Before:
```
Finished in 4.55 seconds (files took 8.14 seconds to load)
65 examples, 0 failures
[TEST PROF INFO] Time spent in factories: 00:02.833 (39.19% of total time)
[TEST PROF INFO] Factories usage
Total: 254
Total top-level: 227
Total time: 00:02.833 (out of 00:10.861)
Total uniq factories: 7
total top-level total time time per call top-level time name
221 221 2.6216s 0.0119s 2.6216s work_package
7 2 0.1100s 0.0157s 0.0777s user
7 0 0.0167s 0.0024s 0.0000s notification_setting
6 1 0.2549s 0.0425s 0.1045s project_with_types
6 1 0.0245s 0.0041s 0.0130s priority
6 1 0.0244s 0.0041s 0.0142s status
1 1 0.0024s 0.0024s 0.0024s closed_status
```
After:
```
Finished in 3.59 seconds (files took 8.25 seconds to load)
65 examples, 0 failures
[TEST PROF INFO] Time spent in factories: 00:01.857 (29.59% of total time)
[TEST PROF INFO] Factories usage
Total: 131
Total top-level: 129
Total time: 00:01.857 (out of 00:09.947)
Total uniq factories: 7
total top-level total time time per call top-level time name
123 123 1.6649s 0.0135s 1.6649s work_package
2 2 0.0780s 0.0390s 0.0780s user
2 0 0.0112s 0.0056s 0.0000s notification_setting
1 1 0.0946s 0.0946s 0.0946s project_with_types
1 1 0.0084s 0.0084s 0.0084s priority
1 1 0.0096s 0.0096s 0.0096s status
1 1 0.0017s 0.0017s 0.0017s closed_status
```
Use `shared_association_default` to create default values to be used for
factory associations in rspec. They get created only once.
For instance, when creating work packages with `create(:work_package)`,
a new user gets created for each create work package. To reuse the same
user for all created work packages, add this in your example group:
shared_association_default(:user) { create(:user) }
Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.
Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
Uses FactoryBot to keep and maintain specific records in a special transaction that does not get removed after each spec.
They automatically are created whenever first hitting them.
This makes an excellent time saver for items that are commonly used, such as an admin user account