Skip to content

Conversation

@aaronskiba
Copy link
Contributor

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)

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.
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`)
@github-actions
Copy link

</tr>
1 Error
🚫

Please include a CHANGELOG entry.

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

Generated by 🚫 Danger

@johnpinto1 johnpinto1 self-requested a review December 18, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants