Skip to content

Commit

Permalink
Unit test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stevelong00 committed Jan 8, 2025
1 parent 88e5ced commit da04df3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/ivc_champva/spec/services/attachments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ def initialize(form_id, uuid, data)
.and_raise(StandardError.new('Rename failed'))
expect(File).to receive(:rename).with('attachmentD.jpg', "./#{uuid}_#{form_id}_supporting_doc-3.pdf")

expected_error_message = 'Unable to process all attachments: '
expected_error_message += 'Error processing attachment at index 1: Rename failed, '
expected_error_message += 'Error processing attachment at index 2: Rename failed'
expect do
test_instance.handle_attachments(file_path)
end.to raise_error(StandardError,
'Unable to process all attachments: Error processing attachment at index 1: Rename failed, \
Error processing attachment at index 2: Rename failed')
end.to raise_error(StandardError, expected_error_message)
end
end
end
Expand Down

0 comments on commit da04df3

Please sign in to comment.