GRI-1980: acceptance tests for campus scope and permissions on media and playlists #177

Merged
vivy merged 1 commit from test/GRI-1980-media-playlist-permission-scoping into dev 2026-11-14 02:53:54 +00:00
Member

Summary

Acceptance tests for #172, written before the implementation, per Aetherforge's QA-first block on #172. These fail on dev today; #172 makes them pass.

Added crates/server/tests/media_playlist_permission_scoping_acceptance_integration.rs — 25 tests, one per #172's "Done when" bullet:

  • media/playlist list scoped to own campus + "all"
  • get/update/delete by id outside scope answers 404, not 403
  • create sets campus_id from the user; create in another campus or as "all" is refused
  • upload without content_upload refused; playlist edit/device assignment without content_assign refused
  • playlist cannot be assigned to a device outside the user's scope
  • the media-delete 409 media_in_use conflict does not name a playlist the caller cannot see

Fail-first evidence

Against dev (441951b, unimplemented):

SIGNAGE_TEST_DATABASE_URL="postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable" \
  cargo test --package server --test media_playlist_permission_scoping_acceptance_integration -- --include-ignored --test-threads=4

18 failed, 7 passed (the 7 passing are same-campus happy-path pairs that already work without scoping).

Test plan

  • cargo fmt clean
  • cargo clippy --test media_playlist_permission_scoping_acceptance_integration -- -D warnings clean
  • scripts/local-gates.sh --rust-only green
  • CI on this PR (forge-isolated run)
## Summary Acceptance tests for #172, written before the implementation, per Aetherforge's QA-first block on #172. These fail on `dev` today; #172 makes them pass. Added `crates/server/tests/media_playlist_permission_scoping_acceptance_integration.rs` — 25 tests, one per #172's "Done when" bullet: - media/playlist list scoped to own campus + "all" - get/update/delete by id outside scope answers 404, not 403 - create sets `campus_id` from the user; create in another campus or as "all" is refused - upload without `content_upload` refused; playlist edit/device assignment without `content_assign` refused - playlist cannot be assigned to a device outside the user's scope - the media-delete 409 `media_in_use` conflict does not name a playlist the caller cannot see ## Fail-first evidence Against `dev` (441951b, unimplemented): ``` SIGNAGE_TEST_DATABASE_URL="postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable" \ cargo test --package server --test media_playlist_permission_scoping_acceptance_integration -- --include-ignored --test-threads=4 ``` 18 failed, 7 passed (the 7 passing are same-campus happy-path pairs that already work without scoping). ## Test plan - [x] `cargo fmt` clean - [x] `cargo clippy --test media_playlist_permission_scoping_acceptance_integration -- -D warnings` clean - [x] `scripts/local-gates.sh --rust-only` green - [ ] CI on this PR (forge-isolated run)
GRI-1980: acceptance tests for campus scope and permissions on media and playlists
Some checks failed
CI / the pre-push hook (pull_request) Successful in 16s
CI / cargo fmt (pull_request) Successful in 24s
CI / cargo deny advisories (pull_request) Failing after 1m46s
CI / cargo deny (pull_request) Successful in 1m55s
CI / cargo clippy (pull_request) Successful in 3m12s
CI / repository boundary (pull_request) Successful in 1m25s
CI / cargo test (pull_request) Successful in 4m21s
CI / frontend-web (pull_request) Successful in 2m10s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 21s
475b247fc5
vivy merged commit fc9d38fe94 into dev 2026-11-14 02:53:54 +00:00
vivy deleted branch test/GRI-1980-media-playlist-permission-scoping 2026-11-14 02:53:54 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!177
No description provided.