-
Notifications
You must be signed in to change notification settings - Fork 11
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
CA-1176 allow children to be deleted without remove_child on parent #503
Conversation
@@ -411,6 +411,43 @@ class ResourceRoutesV2Spec extends AnyFlatSpec with Matchers with TestSupport wi | |||
} | |||
} | |||
|
|||
it should "204 deleting a child resource" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test was moved from below and amended not to require the remove_child
action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for these comments!
} | ||
} | ||
|
||
it should "400 when attempting to delete a resource with children" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test was moved from below (it was in the wrong place)
} | ||
} | ||
|
||
it should "403 if user is missing remove_child on parent resource if it exists" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test was removed
@@ -1395,39 +1432,6 @@ class ResourceRoutesV2Spec extends AnyFlatSpec with Matchers with TestSupport wi | |||
} | |||
} | |||
|
|||
"DELETE /api/resources/v2/{resourceTypeName}/{resourceId}" should "204 on a child resource if the user has remove_child on the parent resource" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved up
@@ -1482,26 +1486,6 @@ class ResourceRoutesV2Spec extends AnyFlatSpec with Matchers with TestSupport wi | |||
} | |||
} | |||
|
|||
it should "400 when attempting to delete a resource with children" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 comment then 👍
requireParentAction(resource, None, SamResourceActions.removeChild, userInfo.userId, samRequestContext) { | ||
complete(resourceService.deleteResource(resource, samRequestContext).map(_ => StatusCodes.NoContent)) | ||
} | ||
complete(resourceService.deleteResource(resource, samRequestContext).map(_ => StatusCodes.NoContent)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be helpful to leave a comment about why we are intentionally not requiring removeChild here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
@@ -411,6 +411,43 @@ class ResourceRoutesV2Spec extends AnyFlatSpec with Matchers with TestSupport wi | |||
} | |||
} | |||
|
|||
it should "204 deleting a child resource" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for these comments!
jenkins retest |
Ticket: https://broadworkbench.atlassian.net/browse/CA-1176
PR checklist