Add test that creating prototype checklist in camp prototype is denied for unrelated user

Open Beginner friendly
#11,384 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
api, testing

Research direction

Start with the 403 case around line 112 of api/tests/Api/ChecklistItems/CreateChecklistItemTest.php, and check how the markAsPrototype('checklist1campPrototype') fixture helper is used elsewhere in the test suite. Add a case where an unrelated user creates a checklist item in a camp prototype, then run that test class to confirm it returns 403. Done when the new case passes and the prototype fixture is actually marked as a prototype.

Written by the indexing model from the issue text.

Description

https://github.com/simfeld/ecamp3/blob/8d203cda8921bf42ab35c6e0d9bfd10cd27048dc/api/tests/Api/ChecklistItems/CreateChecklistItemTest.php#L112

Could we also run this 403 check with markAsPrototype('checklist1campPrototype')? The fixture currently leaves isPrototype false, so the test doesn’t cover the case affected by this change.

Originally posted by @manuelmeister in https://github.com/ecamp/ecamp3/pull/11345#discussion_r4658116102

Dominant language
PHP
Stars
160
Forks
74
Avg merge
15h 47m
Merged PRs (30d)
251

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ecamp/ecamp3

All issues in ecamp/ecamp3

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.