mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 22:54:47 +02:00
- Remove `Que::Mailer` (#895) - Extract controllers - Extract translations - Convert HAML to ERB - Add mailer preview - Improve UI - Remove unused routes - Add tests
22 lines
No EOL
569 B
Ruby
22 lines
No EOL
569 B
Ruby
require 'test_helper'
|
|
|
|
class InvoiceMailerTest < ActiveSupport::TestCase
|
|
include ActionMailer::TestHelper
|
|
|
|
setup do
|
|
@invoice = invoices(:one)
|
|
ActionMailer::Base.deliveries.clear
|
|
end
|
|
|
|
def test_delivers_invoice_email
|
|
assert_equal 1, @invoice.number
|
|
|
|
email = InvoiceMailer.invoice_email(invoice: @invoice, recipient: 'billing@bestnames.test')
|
|
.deliver_now
|
|
|
|
assert_emails 1
|
|
assert_equal ['billing@bestnames.test'], email.to
|
|
assert_equal 'Invoice no. 1', email.subject
|
|
assert email.attachments['invoice-1.pdf']
|
|
end
|
|
end |