25 Commits

Author SHA1 Message Date
Oliver Günther 0f1f0e62cb Reduce visibility of principals to common memberships or view_all_principals permission 2025-10-23 12:59:56 +02: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
ulferts 4753fc7b9e attempt to stabilize flickering spec 2025-04-17 09:49:39 +02:00
Oliver Günther cd2d0f0e1a Remove primerized_flash prefix in methods 2024-09-30 21:39:36 +02:00
Oliver Günther 1cf49e2c9f Adapt specs 2024-09-30 20:37:00 +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 8fa8584538 Run rubocop --autocorrect on all files
Only the safe cops have run. rubocop version is 1.59.0.
2024-01-05 15:27:09 +01:00
ulferts 8c291c0000 fix specs 2023-10-12 16:07:40 +02:00
ulferts 5b2bc41f41 Merge remote-tracking branch 'origin/dev' into easier-factory-role-setup 2023-10-12 12:09:27 +02:00
ulferts 2b2abf864a introduce ProjectRole model 2023-10-09 14:34:20 +02:00
Klaus Zanders a256fd85ac Fix a bunch of more usages of member_in_project that was overlooked 2023-10-09 10:40:45 +02:00
Klaus Zanders 78c1e4fadb Switch all uses of principal factories to use new interface 2023-10-09 10:39:44 +02:00
bsatarnejad 85411f20c7 change tests due to replacing .flash with .op-toast 2023-07-18 16:47:45 +02: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 9e865b4f7b lint: Run rubocop safe autocorrect
Command is `rubocop --safe --autocorrect app lib lib_static modules spec`
2023-03-09 10:25:57 +01: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 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Christophe Bliard 47a297daae Fix argument alignment since f08bea3467 (#10129)
* Fix argument alignment since f08bea3467

The FactoryBot.* prefix has been removed in f08bea3467. Since then
rubocop complains about Layout/ArgumentAlignment. This commit fixes it.

* do not fix alignments for modules/*/spec yet

hoping to be under the limit of 65535 characters for reviewdog to report on rubocop errors
2022-02-02 21:48:06 +01:00
Oliver Günther f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
Oliver Günther b415c3771f Fix specs using a nil user context 2021-07-26 13:49:45 +02:00
ulferts 9fa5599392 Feature/member notifications (#8958)
* spec with correctly scoped links

* move db check into own file - fix deprecation

* basic spec for member creation service

* use constants for all notifications

* send an OP notification after member has been created

* send an OP notification after member has been updated

* mails on group member added

Depending on whether the membership existed before or not, an updated or
a created notification is send. This is done asynchronously.

* move all mail sender background jobs into namespace

* wip

* wip

* correct handling group member notifications

* add setting enable/disable mail sending on member alterations

* use services in members controller

* move Notifiable to OpenProject

* remove member after save hooks

* cleanup/testing/linting

* render member mails in receiver locale

* remove add_member! method

* use mailer layout for all mailers

* Update app/services/groups/cleanup_inherited_roles_service.rb

Co-authored-by: Oliver Günther <mail@oliverguenther.de>

* use around callback to avoid prepending

* handle nil params

Co-authored-by: Oliver Günther <mail@oliverguenther.de>
2021-04-20 13:45:42 +02:00
Oliver Günther e9f1781d2b Use contracted member services and show only manageable projects in user administration (#9076)
* Reuse contracted services in memberships controller

* Show only manageable projects

* Show only manageable projects in select box

* Reject empty values in role_ids

* Add spec for when user has no manage_members permission

* Also handle delete through service

* Extend spec for when user has no manage_members permission

* Extend Members SetAttributesSpec

* Make manageable_Members an instance method and add spec

* hide buttons if user is not allowed to use them

* Rename manageable_projects to assignable_projects

* Build a membership for the contract

* Fix url for global_roles to work with update and create methods

Co-authored-by: ulferts <jens.ulferts@googlemail.com>
2021-03-09 15:57:48 +01:00
Oliver Günther bbeae32698 [35508] Add global permission to manage placeholder users (#9000)
* Add global permission to manage (but not delete) placeholders

https://community.openproject.com/work_packages/35508

* Restore breadcrumbs for non-show routes

* Remove permissions to memberships for add_placeholder_user permission

* Allow non-admins with global permission to access membership

* Remove permissions to memberships for add_placeholder_user permission

* Rename shared_examples for admin contract validations

Co-authored-by: ulferts <jens.ulferts@googlemail.com>
2021-02-16 14:16:35 +01:00