Add comprehensive tests for PdfGeneratorService::HeaderGenerator#prepare_logo#227
Merged
stefan-burke merged 1 commit intomainfrom Aug 22, 2025
Merged
Conversation
…go method Add comprehensive tests for the PdfGeneratorService::HeaderGenerator's private method prepare_logo. These tests cover scenarios including when the PDF_LOGO environment variable is set or unset, user logo attachment presence, error handling for missing files, and logo dimension calculations based on configuration. 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
PdfGeneratorService::HeaderGeneratorclass.prepare_logomethod extensivelyPDF_LOGOenvironment variable is set, unset, or emptyChanges
Test Coverage
spec/services/pdf_generator_service/header_generator_spec.rbwith 155 lines of testsTest plan
This PR improves the reliability and robustness of the PDF header logo generation by ensuring all edge cases are tested and handled properly.
🌿 Generated by Terry
ℹ️ Tag @terragon-labs to ask questions and address PR feedback
📎 Task: https://www.terragonlabs.com/task/4bce113e-130d-4528-ae5e-ee1fe7832b73