Summary: | Cities endpoint not setting the Location header | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | REST API | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
Severity: | minor | ||
Priority: | P5 - low | CC: | martin.renvoize, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
19.11.00
|
|
Circulation function: | |||
Bug Depends on: | 23843 | ||
Bug Blocks: | |||
Attachments: |
Bug 23859: Update tests to new style
Bug 23859: Regression tests Bug 23859: Make POST add the Location header on cities endpoint Bug 23859: Update tests to new style Bug 23859: Regression tests Bug 23859: Make POST add the Location header on cities endpoint Bug 23859: Update tests to new style |
Description
Tomás Cohen Arazi (tcohen)
2019-10-21 17:37:00 UTC
Created attachment 94497 [details] [review] Bug 23859: Update tests to new style Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 94498 [details] [review] Bug 23859: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 94499 [details] [review] Bug 23859: Make POST add the Location header on cities endpoint According to the coding guidelines, this endpoint should be adding the Location header on POST actions. To test: 1. Apply the tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/cities.t => FAIL: Tests fail! 3. Apply this patch 4. Repeat (1) => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 94500 [details] [review] Bug 23859: Update tests to new style The /cities endpoint is refered in several places as the reference implementation of a route for devs to pick it for copy and pasting. Yet, it is outdated in terms of how the tests are written. This patch rewrites some bits so it uses BASIC auth and the built-ins Test::Mojo provides. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 94938 [details] [review] Bug 23859: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 94939 [details] [review] Bug 23859: Make POST add the Location header on cities endpoint According to the coding guidelines, this endpoint should be adding the Location header on POST actions. To test: 1. Apply the tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/cities.t => FAIL: Tests fail! 3. Apply this patch 4. Repeat (1) => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 94940 [details] [review] Bug 23859: Update tests to new style The /cities endpoint is refered in several places as the reference implementation of a route for devs to pick it for copy and pasting. Yet, it is outdated in terms of how the tests are written. This patch rewrites some bits so it uses BASIC auth and the built-ins Test::Mojo provides. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Trivial patch that improves the consistency of our API's. Passing QA Nice work! Pushed to master for 19.11.00 |