21 Commits

Author SHA1 Message Date
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00
Christophe Bliard 1517b7cee0 [59539] Reschedule related work packages when deleting
From the deleted work package, its parent, its successors, and the
successors of its descendants are rescheduled and switched to manual
scheduling if appropriate.
2025-02-25 09:18:28 +01:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Aaron Contreras fa9a44d24b Run rubocop -a on spec 2024-03-01 18:34:17 -05:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
Christophe Bliard ebf476bb5e Make 20% faster work_packages/update_ancestors_service_spec
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
```
2023-10-12 11:54:57 +02:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard c0132aabca Introduce rspec helper to improve performance
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) }
2022-06-29 12:09:08 +02:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
Oliver Günther ad07264c4f [36937] Fix navigation to active wiki item and add spec for it (#9264)
https://community.openproject.org/wp/36937
2021-05-12 14:09:18 +02:00
luz paz 3683042c9b Fix typos in user facing and non-user facing code
Found via `codespell v2.1.dev0`
2021-01-24 15:08:21 +01:00
ulferts 6140f4c7e9 update copyright to 2021 (#8925)
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
2021-01-13 17:47:45 +01:00
Oliver Günther 53f2d694ff Use AnyFixtures to generate fixtures from factories (#7230)
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
2020-04-09 11:54:26 +02:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
Oliver Günther c3226bf2c0 Reload shared_lets by default 2018-12-03 10:31:58 +01:00
Jens Ulferts e58a96515c allow setting attachments through wp post/patch 2018-06-04 09:11:26 +02:00
Oliver Günther b79e4c7125 Bump test-prof to re-use their let_it_be shared_let replacement (#6193)
* Bump test prof for shared_let

* Use `let_it_be` from test-prof


[ci skip]
2018-02-26 07:35:12 +01:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Oliver Günther 1ef1e709d8 Add shared let(:foo) { } helper for before-all initialized resources (#5910)
* Add shared let

* Fix some exemplary tests
2017-09-19 13:56:05 +02:00