Add comprehensive request specs for InspectionsController with enhanced coverage and error handling#222
Merged
stefan-burke merged 3 commits intomainfrom Aug 22, 2025
Conversation
…troller - Add extensive request specs covering GET show, PATCH update, PATCH update_unit, GET log actions - Test handling of image processing errors, unit updates, event logging, and assessment params - Verify behavior with assessments disabled and inactive users - Include tests for prefill functionality, validation, and error handling - Ensure coverage of event logging and change tracking in inspection updates - Improve test coverage and robustness for inspections feature Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
…ests and logging - Use actual InspectionBlueprint rendering for JSON response test - Add tests for assessment params handling including updates and filtering - Enhance error logging test in production environment - Refine prefill field translation tests for assessments - Verify change tracking and event logging on inspection updates - Remove mocks and improve test reliability and coverage Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
…ller - Add tests for assessments disabled scenario returning 404 - Add JSON format response test for inspection data - Add image processing error handling test - Add event logging verification on unit change - Add HEAD request test for inspections - Add inspection event log display test - Add prefill functionality tests for inspection edit - Add validation for tab parameter in edit action - Add error handling tests for inspection event logging - Add tests for tracking changes in inspection updates - Add tests for validating inspection completability with error handling This commit significantly improves test coverage and robustness of the inspections controller. Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Request Specs
spec/requests/inspections/inspections_coverage_spec.rbwith 416 lines of testsspec/requests/inspections/inspections_spec.rbwith 292 lines of additional testsGET /showincluding HEAD requests and JSON format responsesPATCH /updatehandling image processing errors gracefullyPATCH /update_unitwith success and failure scenariosGET /logto verify inspection event logsTest plan
🌿 Generated by Terry
ℹ️ Tag @terragon-labs to ask questions and address PR feedback
📎 Task: https://www.terragonlabs.com/task/ad86a8ec-5585-4145-b7a5-2b332a846b97