roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

Add v2 API Test Coverage and Address Uncovered Bugs

Open aaronskiba opened this issue 4 weeks ago • 1 comments

Changes proposed in this PR:

Add v2 API test coverage

This test suite was adapted from the v2 API tests in CDLUC3/dmptool.

The original request and view specs were copied and then refactored to align with our v2 API. Supporting factories and spec helper files were updated as needed to accommodate the new coverage.

Fix bugs uncovered by v2 API test coverage

These changes resolve the following issues uncovered via the API v2 tests:

  • app/views/api/v2/_standard_response.json.jbuilder
    • Failure rendering json.client when @client is nil (undefined method name for nil)
  • app/views/api/v2/datasets/_show.json.jbuilder
    • Failure rendering output.doi_url when output is present (undefined method doi_url)
  • app/views/api/v2/templates/index.json.jbuilder
    • Failure in mapping template_ids when some nested keys are nil (undefined method [] for nil)
  • config/routes.rb
    • Spec failures due to undefined route helpers in test context (e.g., api_v2_templates_path)

aaronskiba avatar Dec 16 '25 20:12 aaronskiba

</tr>
1 Error
:no_entry_sign:

Please include a CHANGELOG entry.

You can find it at [CHANGELOG.md](https://github.com/DMPRoadmap/roadmap/blob/main/CHANGELOG.md).
1 Warning
:warning: This PR is too big! Consider breaking it down into smaller PRs.

Generated by :no_entry_sign: Danger

github-actions[bot] avatar Dec 16 '25 20:12 github-actions[bot]