forked from rubyforgood/human-essentials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Binary file not shown.
Binary file not shown.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module DistributionPDFHelper | ||
def set_delivery_and_compare(described_class, delivery_method, organization, distribution, expected_file_md5) | ||
distribution.update!(delivery_method: delivery_method, issued_at: DateTime.new(2024, 7, 4, 0, 0)) | ||
|
||
# user = create(:user, organization: organization) | ||
# sign_in(user) | ||
# visit distributions_path | ||
# binding.pry | ||
# | ||
# use this along with RSpec type: :system to update expected PDF | ||
get print_distribution_path(distribution) | ||
File.write(Rails.root.join("spec", "fixtures", "files", "distribution_expected_RENAME.pdf"), response.body) | ||
|
||
pdf = described_class.new(organization, distribution) | ||
output_file_md5 = Digest::MD5.hexdigest pdf.compute_and_render | ||
expect(output_file_md5).to eq(expected_file_md5) | ||
end | ||
end |