Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement tests for sharing project queries #16032

Draft
wants to merge 15 commits into
base: release/14.3
Choose a base branch
from

Conversation

klaustopher
Copy link
Contributor

@klaustopher klaustopher commented Jul 3, 2024

Follow up to #15971 adding all the tests


Tests

NOTE: Not being able to edit means you can make changes to the query but then it only offers the "Save as" function

  • User Permissible service for non-project scoped resources are not tested yet
  • Tests for the SharesController
  • Feature Tests for the entire ProjectQuery sharing workflow
    • Adding a share and accessing the project query with the shared user (@aaron-contreras)
    • Adding a share with edit and changing with the shared user ( @aaron-contreras )
    • Making a query public and accessing it with another user (not allowed to edit)
    • Making a query public and adding a share with edit permission and then editing it as shared user
    • Making a query public and the owner not having the manage_public_project_queries and not being able to edit

Found while writing specs

  • Re-work UserDetailsComponent to be entity specific (current work package specific details don't fit with a non-project scoped resource like a project query)
  • As a user that has been shared a project list with edit permissions, I'm not able to edit the project query by clicking "Save"

See: https://community.openproject.org/work_packages/55163

@klaustopher klaustopher changed the title Start SharesController specs Implement tests for sharing project queries Jul 3, 2024
Base automatically changed from implementation/55163-build-sharing-modal to release/14.3 July 4, 2024 06:33
@@ -57,10 +57,10 @@ def user_is_logged_in

def allowed_to_modify_private_query
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I second guessed whether using #model.editable? here as it's quite broad but would be consistent with the rest of checks in other places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants