123456789101112131415161718192021222324252627282930 |
- require 'rails_helper'
- RSpec.describe TicketArticleCommunicateEmailJob, type: :job do
- describe '#perform' do
- context 'for an email article' do
- let(:article) { create(:ticket_article, type_name: 'email') }
- let(:recipient_list) { [article.to, article.cc].compact_blank.join(',') }
- before { allow(Rails.logger).to receive(:info) }
-
-
-
-
-
-
-
-
- it 'records outgoing email dispatch to Rails log' do
- described_class.perform_now(article.id)
- expect(Rails.logger)
- .to have_received(:info)
- .with("Send email to: '#{recipient_list}' (from #{article.from})")
- end
- end
- end
- end
|