Skip to content

Increase Inspection Model Test Coverage and Remove Deprecated Method#249

Merged
stefan-burke merged 2 commits intomainfrom
terragon/increase-inspection-test-coverage
Sep 1, 2025
Merged

Increase Inspection Model Test Coverage and Remove Deprecated Method#249
stefan-burke merged 2 commits intomainfrom
terragon/increase-inspection-test-coverage

Conversation

@stefan-burke
Copy link
Copy Markdown
Member

Summary

  • Removes deprecated completion_status method from Inspection model
  • Adds extensive test coverage for Inspection model methods including area, volume, completion status, audit logging, and assessment iteration

Changes

Model Updates

  • Deleted completion_status method from Inspection model as it was unused

Test Coverage Enhancements

  • Added tests for #area method covering nil and valid dimension cases
  • Added tests for #volume method covering nil and valid dimension cases
  • Added tests for #un_complete! method verifying state reset and audit logging
  • Added tests for #each_applicable_assessment method verifying correct assessments yielded based on conditions
  • Added tests for #completion_errors method verifying error messages for missing unit and incomplete fields
  • Added tests for #log_audit_action method verifying event logging

Test plan

  • Run full model spec suite to ensure all new tests pass
  • Confirm no regressions in existing inspection functionality
  • Verify coverage report shows increased coverage for Inspection model

🌿 Generated by Terry


ℹ️ Tag @terragon-labs to ask questions and address PR feedback

📎 Task: https://www.terragonlabs.com/task/2e56a5cb-f8b0-4744-be4e-78403b5d0db0

stefan-burke and others added 2 commits September 1, 2025 02:10
- Added tests for #area and #volume methods covering nil and valid dimensions
- Added tests for #un_complete! method to verify state reset and audit logging
- Added tests for #each_applicable_assessment to verify yielded assessments and conditional logic
- Added tests for #completion_errors to check error messages for missing data
- Added tests for #log_audit_action to ensure event logging
- Removed deprecated #completion_status method from Inspection model

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
The test for `each_applicable_assessment` was changed to expect a TypeError when no block is given, reflecting the Sorbet signature requirement for a block.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
@stefan-burke stefan-burke marked this pull request as ready for review September 1, 2025 02:16
@stefan-burke stefan-burke merged commit 6ff910c into main Sep 1, 2025
16 of 17 checks passed
@stefan-burke stefan-burke deleted the terragon/increase-inspection-test-coverage branch October 12, 2025 22:50
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.

1 participant