Skip to content

Remove JsonSerializerService and update related tests#228

Merged
stefan-burke merged 1 commit intomainfrom
terragon/remove-json-serializer-service
Aug 22, 2025
Merged

Remove JsonSerializerService and update related tests#228
stefan-burke merged 1 commit intomainfrom
terragon/remove-json-serializer-service

Conversation

@stefan-burke
Copy link
Copy Markdown
Member

Summary

  • Completely removes the JsonSerializerService class and its associated spec file
  • Updates tests to no longer call JsonSerializerService directly
  • Modifies request specs to test JSON responses through API endpoints instead of direct serialization

Changes

Code Removal

  • Deleted app/services/json_serializer_service.rb which provided JSON serialization for units, inspections, and assessments
  • Deleted spec/services/json_serializer_service_spec.rb which contained extensive tests for the removed service

Test Updates

  • In spec/requests/api/units_json_inspection_history_spec.rb, replaced direct calls to JsonSerializerService.serialize_unit with actual API requests to /units/:id.json and parsing the response
  • In spec/requests/api/units_json_real_world_spec.rb, removed direct serialization calls and rely solely on API endpoint responses
  • In spec/requests/inspections/inspections_spec.rb, removed stubbing of JsonSerializerService.serialize_inspection and added assertions on actual JSON response keys to verify presence of expected data

Test plan

  • Verified all modified request specs pass successfully
  • Confirmed that JSON responses from API endpoints contain expected keys and data without relying on the removed service
  • Ensured no references to JsonSerializerService remain in the codebase or tests

🌿 Generated by Terry


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

📎 Task: https://www.terragonlabs.com/task/27a0505b-fd58-4928-b4ed-66f7849da27e

Refactored the unit JSON inspection history and real-world specs to test JSON responses through actual API endpoints instead of directly calling the serializer service. Also enhanced the inspections spec to verify JSON response structure and content when serving JSON format. This improves test coverage by validating the full request-response cycle.

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 August 22, 2025 11:04
@stefan-burke stefan-burke merged commit b5e78bc into main Aug 22, 2025
16 of 17 checks passed
@stefan-burke stefan-burke deleted the terragon/remove-json-serializer-service branch October 12, 2025 22:51
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