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.
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
* basic members collection response
* complete member index end point
* document versions#index
* remove user association from members
There is already a more generic principals association. Having both causes confusion and leads to duplicate loading of models
* linting
* remove disabled test
* add members#show api end point
* add project and principal to member representer
* replace member.user reference with principal
* use principal reference in project members association
* modernize roles api
* complete member representer rendering
* replace remnants of user association
* add member schema api endpoint
* have dedicated available projects end point for versions
* linting
* limit roles to assignable ones in schema
* rename member to membership in api
* remove remnants of user in member
* spec fixes
* use available_projects endpoint in versions board
* add eager loading to memberships#index
* members create form api endpoint
* ensure role exists for default assignment
* extract switch for users/groups to work_packages representer
* document membership create form
* add l10n expected in specs
* strengthen the usage of a delete base service
* use base class for set attributes service
* fix alias in service
* add create endpoint to members api
* document members create endpoint
* linting
* adapt to altered service signature
* use default endpoint for wp#get
* use CF infused representer
[ci skip]
additionally fixes:
* with "all" selected, all members are shown, not only those being
active, invited or registered
* with "locked" selected, locked users are now displayed.
* the Project#members_principals associations lacked the `references`
method which lead to the users table being undefined in the resulting
query.
In order to achive the bug fixes, the member filtering is now based on
the query engine also used for users, queries, work_packages, ... As a
lot of the members filters are very similar to user filters (in fact, a lot of the
members filter work on the users model), those filters are shared via
modules.
[ci skip]
* 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]
Fixes in spec/controllers:
```
DEPRECATION WARNING: ActionController::TestCase HTTP request methods will accept only
keyword arguments in future Rails versions.
```