Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

test: hold the scope and show? of a meeting each on its own

Guido Boyke42d9df77c312
diff --git a/CLAUDE.md b/CLAUDE.md
index ac2805d..50c2f97 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -920,8 +920,8 @@ rule of knowledge, before the project (a 422 says nothing about it). The list's
`Api::V1::ReadableProject`, shared with knowledge; a reader without the meetings area gets an
empty list. `Api::V1::ReadableMeeting` answers one 404 in status and body for missing, malformed,
out of reach, foreign and no area, and turns a policy refusal into that 404 as well: unlike a
-ticket, a meeting never answers 403. An archived project is the web's: closed to a member (scope
-alone would let them in, `show?` keeps them out), open to an account admin. Guard:
+ticket, a meeting never answers 403. An archived project is the web's: closed to a member, open
+to an account admin. Guard:
`spec/requests/api/v1/meetings_read_spec.rb`.
`GET /api/v1/organisations/:organisation_id/people` and `.../people/:id` (People S3b) read
diff --git a/spec/requests/api/v1/meetings_read_spec.rb b/spec/requests/api/v1/meetings_read_spec.rb
index 89d2250..518fec4 100644
--- a/spec/requests/api/v1/meetings_read_spec.rb
+++ b/spec/requests/api/v1/meetings_read_spec.rb
@@ -396,17 +396,26 @@ RSpec.describe 'REST meetings', :ci_guard, type: :request do
expect_not_found(show(held.id, pat: pat))
end
- it 'for a member of an archived project, whose grant the policy scope still names' do
+ it 'for a member of an archived project' do
quietly { project.update!(archived_at: Time.current) }
expect_not_found(show(held.id))
end
- it 'when the policy alone refuses: never a 403, which would tell the meeting exists' do
+ # The scope and show? agree on every grant there is, so no data separates them. Each is
+ # held here on its own, or a slip in the other would stand unseen.
+ it 'when show? alone refuses: never a 403, which would tell the meeting exists' do
allow_any_instance_of(MeetingPolicy).to receive(:show?).and_return(false)
expect_not_found(show(held.id))
end
+
+ it 'when the policy scope alone refuses' do
+ held
+ allow_any_instance_of(MeetingPolicy::Scope).to receive(:resolve).and_return(Meeting.none)
+
+ expect_not_found(show(held.id))
+ end
end
it 'answers 401 without a token' do