Skip to content

Cover the refresh branch and four more refusals - #726

Merged
blaipr merged 1 commit into
mainfrom
test/create-and-view-refusals
Aug 13, 2026
Merged

Cover the refresh branch and four more refusals#726
blaipr merged 1 commit into
mainfrom
test/create-and-view-refusals

Conversation

@blaipr

@blaipr blaipr commented Aug 13, 2026

Copy link
Copy Markdown
Member

What

7 tests closing the last gaps in four controllers.

The refresh branch

Refreshing an authorisation is a different persistence path from editing one: the token is regenerated and the vault re-encrypted, through two updates keyed on the user rather than the single one a plain edit makes. The response text is identical either way, so the test tells the branch apart by which queries actually ran — which is the only thing that distinguishes them from outside.

Four refusals

  • Creating a custom field or an item preset without permission.
  • Viewing a field definition that has been deleted — reported as not found, matching what its sibling edit route already answers.
  • A database failure while saving a field, and while loading the users/groups/profiles pickers a preset form needs — each reported rather than escaping as an unhandled error.

Testing

Integration: 50 tests green across the three classes, no deprecations or notices. All four controllers are now fully covered, and no gap in them turned out to be an accessor or an unreachable branch.

Refreshing an authorisation is a different persistence path from editing one:
the token is regenerated and the vault re-encrypted, through two updates keyed
on the user rather than the single one an edit makes. The response text is the
same either way, so the branch is told apart by which queries actually ran.

The rest are refusals that had nothing on them: creating a custom field or a
preset without permission, viewing a field definition that has been deleted, and
a database failure while saving a field or while loading the pickers a preset
form needs — each reported rather than escaping as an unhandled error.

The permission denials are unit-shaped by necessity: the integration harness's
ACL always says yes.
@blaipr
blaipr merged commit c5251b1 into main Aug 13, 2026
8 checks passed
@blaipr
blaipr deleted the test/create-and-view-refusals branch August 13, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant