Add comprehensive RSpec tests for ImageProcessable concern#248
Merged
stefan-burke merged 4 commits intomainfrom Sep 2, 2025
Merged
Add comprehensive RSpec tests for ImageProcessable concern#248stefan-burke merged 4 commits intomainfrom
stefan-burke merged 4 commits intomainfrom
Conversation
…ble concern Add a new spec file for the ImageProcessable concern with 346 lines of tests covering: - process_image_params method for valid, invalid, blank, and non-file inputs - process_image method for valid, invalid, and error scenarios - validate_image! method for validation success and failure - handle_image_error method for different error handling formats - rescue_from handlers for image-related errors - integration with ActionController::Parameters This ensures robust test coverage for image processing functionality in controllers. Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
… processing - Added new flash partial for displaying flash messages in views. - Expanded ImageProcessable concern controller tests with new test methods for create, upload, validate actions. - Added tests for error handling methods and rescue_from handlers for image processing errors. - Improved test coverage for image validation, processing, and error scenarios. - Refactored test syntax for consistency and clarity. Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
…ith flash - Changed turbo_stream error response to redirect_back with status :see_other instead of rendering a partial. - Updated specs to expect redirect and flash message handling for turbo_stream format. - Improved test formatting and consistency in image_processable_spec.rb. 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
ImageProcessableconcern in the controller contextChanges
New Test Suite:
image_processable_spec.rbImageProcessablewith routes forcreate,upload, andvalidateactionsNotAnImageErrorandImageProcessingErrorNotAnImageErrorand redirect with alertNotAnImageErrorwith appropriate responseNotAnImageErrorandImageProcessingErrorwith redirects and alertsActionController::Parametersfor image processingTest plan
🌿 Generated by Terry
ℹ️ Tag @terragon-labs to ask questions and address PR feedback
📎 Task: https://www.terragonlabs.com/task/b02ed618-0b63-493c-98a0-60266fe931c1