40 Commits

Author SHA1 Message Date
Alexander Brandon Coles 7b3b6bdbf3 Clean up remaining Backlogs dead code
Restore the minimal admin settings blankslate so the admin menu route
remains valid after the sprint-based cleanup. Remove the remaining
settings-driven story/task classification code, dead models and
services, and the obsolete filter and spec setup that depended on it.
2026-04-17 10:14:14 +01:00
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
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01: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 4c2a9d0aa8 Enable RSpec zero monkey patching mode
The plan for RSpec 4.0 is to disable monkey patching.

See https://github.com/rspec/rspec-core/blob/main/features/configuration/zero_monkey_patching_mode.feature for details.
2023-05-31 19:22:29 +02:00
Christophe Bliard aa23106c11 lint: autocorrect RSpec/FactoryBot/ConsistentParenthesesStyle
command is

    rubocop -A --only RSpec/FactoryBot/ConsistentParenthesesStyle modules spec
2023-03-07 15:04:32 +01:00
Christophe Bliard 10085736da refactor: Rename and generalize #accessor_name as #attribute_name
Also extract #attribute_getter and #attribute_setter when
using #attribute_name in the context of calling the getter/setter
methods.
2023-01-17 09:39:27 +01:00
Christophe Bliard 85b3258a29 Autocorrect with some rubocop cops
RSpec/Rails/InferredSpecType and Style/RedundantConstantBase

rubocop --autocorrect-all --only RSpec/Rails/InferredSpecType,Style/RedundantConstantBase spec modules/*/spec
2023-01-13 14:28:59 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Christophe Bliard a33524ef6d remove ruby magic comment for utf-8
ruby interprets source encoding as utf-8 since 2.0.0, making magic comment redundant and useless
2022-03-10 19:36:58 +01:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Oliver Günther f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +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 2cde433326 Remove usages of AnyFixture (#8987)
AnyFixture will create once instance of a factory for reuse in a number of specs.
This will work fine until we require a clean slate for a specific example.

As we have numerous tests that test like the database is empty,
we get a number of disadvantages:

  - After an example with `with_clean_fixture` metadata, the fixture will only be regenerated
    after the next example that uses it. This means the order of execution will change
    the number of objects in the DB.

  - The more `with_clean_fixture` we have, the smaller the performance advantage of AnyFixture will
    result in.

  - You cannot use an AnyFixture in a spec that needs a clean slate. This should be obvious but was overlooked
    by myself.
2021-02-10 08:59:15 +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 f42ff4bdd6 [28543] Validate Type#attribute_groups in contract
Validating attribute groups is only relevant when creating or
updating the type in the administration. There's no need to validate
this in the type itself.

https://community.openproject.com/wp/28543
2018-09-21 09:20:26 +02:00
Oliver Günther d05c1ff087 [27940] Don't sort members of attribute groups
This will result in wrong orders

https://community.openproject.com/wp/27940
2018-06-28 08:54:41 +02:00
Oliver Günther 059770f533 FactoryGirl => FactoryBot
Removes the deprecation
2018-05-07 22:38:20 +02:00
Oliver Günther e8216bb16e [27611] Restore relations tab (#6300)
* [27611] Restore relations tab

* Remove default children query

[ci skip]
2018-05-07 14:39:36 +02:00
Oliver Günther 0904ed5dbf [27487] Properly reset custom fields when resetting attribute groups
CF on types can still be set through `custom_field_ids=` and is used in
e.g., a number of tests as is the standard way to define custom fields.

This is no problem until resetting the attribute groups, where the
default attribute groups will contain the custom fields formerly
defined.

Thus, explicitly resetting the attribute groups must also reset the
custom_field_ids.

https://community.openproject.com/wp/27487
2018-05-04 08:35:58 +02:00
Oliver Günther 1acccb444a Fix attribute groups model now that fixed children query is removed 2018-04-24 11:39:58 +02:00
Jens Ulferts 519cc56d24 allow attribute_type spec to work with plugins 2018-04-23 11:39:17 +02:00
Jens Ulferts 17d7d2c511 handle query saving, updating, deletion 2018-04-11 13:20:52 +02:00
Jens Ulferts 5a5e3494f9 turn attribute group into dedicated object 2018-04-11 13:20:52 +02:00
Jens Ulferts a33b0bbbbd WIP - return Query as an attribute group
* only default query for now
* only returned when no custom configuration is applied
* start to turn attribute groups into ressources
2018-04-11 13:20:50 +02:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Oliver Günther 39eb01ad42 Reload cached types in attribute groups spec
[ci skip]
2017-09-20 13:55:28 +02:00
ulferts c0b709530c Fix/replace deprecations (#5533)
* replace alias_method_chain

* remove deprecation silencing

* bump controller-testing

* introduce permitted params for settings

* replace various deprecations in controllers

* remove deprecation silencing for legacy_specs

* remove `puts` from spec

* replace deprecated access to errors

* remove unnecessary AR::Parameters usage in spec

* specify error to expect

* replace deprecations

* replace deprecated action calls in legacy function specs

* replace deprecations in functional controller tests

* replace deprecations in controllers/controller_specs

* remove params parser which does not seem to be in effect

It is registered for the content type :exclude which makes no sense as it should deal with :json. The desired behaviour of the api dealing with parsing errors is working with or without the code.

* replace deprecations in unit specs

* replace alias_method_chain

[ci skip]
2017-07-19 21:17:37 +02:00
Oliver Günther 8956700408 [25374] Remove attribute visibility 2017-07-06 13:34:27 +02:00
Oliver Günther ae8c499517 Fix failing specs on CE/myproject config 2017-05-22 07:46:09 +02:00
Oliver Günther 5d50acc50e [25288] Re-add translations to default attribute groups (#5515)
* [25288] Re-add translations to default attribute groups

Uses symbols to mark internal attribute groups and translates them in
the schema representer to the user's locale.

* Extend form configuration front end for translated default groups

* fixing specs

* fix feature spec for attribute groups

* Add symbol test to attribute groups


[ci skip]
2017-05-18 09:17:42 +02:00
Jens Ulferts 2672fb20ae allow empty groups in type form configuration 2017-05-09 13:04:39 +02:00
Oliver Günther 01351399d5 Cache all_work_package_form_attributes
Especially with lots of custom fields, this is otherwise called once per
represented WP and is quite costly.
2017-04-03 08:04:46 +02:00
Oliver Günther 8d381651c8 Fix specs 2017-03-29 13:44:09 +02:00