Sha256: abf6b7e09ef95807aea3fdb2fb0da00d5b3aec01452b85100504ff683eca4656

Contents?: true

Size: 1.12 KB

Versions: 34

Compression:

Stored size: 1.12 KB

Contents

require 'test_helper'

module Workarea
  module Admin
    class StatusReportMailerTest < TestCase
      include TestCase::SearchIndexing
      include TestCase::Mail

      delegate :t, to: :I18n

      def test_showing_dashboard_data
        Workarea.with_config do |config|
          config.email_from = 'noreply@example.com'

          addresses = %w(
            bcrouse@workarea.com
            tscott@workarea.com
          )
          from = [Workarea.config.email_from]
          StatusReportMailer
            .report(addresses, Time.zone.parse('2013/11/13'))
            .deliver_now

          email = ActionMailer::Base.deliveries.last
          html = email.parts.second.body

          assert_includes(html, Workarea.config.site_name)
          assert_includes(html, t('workarea.admin.status_report_mailer.orders.total_orders'))
          assert_includes(html, t('workarea.admin.status_report_mailer.alerts.title'))
          assert_includes(html, Money.default_currency.symbol)
          assert_equal(addresses, email.bcc)
          assert_nil(email.to)
          assert_equal(from, email.from)
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-admin-3.4.25 test/mailers/workarea/admin/status_report_mailer_test.rb
workarea-admin-3.4.24 test/mailers/workarea/admin/status_report_mailer_test.rb
workarea-admin-3.4.23 test/mailers/workarea/admin/status_report_mailer_test.rb
workarea-admin-3.4.22 test/mailers/workarea/admin/status_report_mailer_test.rb
workarea-admin-3.4.21 test/mailers/workarea/admin/status_report_mailer_test.rb
workarea-admin-3.4.20 test/mailers/workarea/admin/status_report_mailer_test.rb
workarea-admin-3.4.19 test/mailers/workarea/admin/status_report_mailer_test.rb
workarea-admin-3.4.18 test/mailers/workarea/admin/status_report_mailer_test.rb
workarea-admin-3.4.17 test/mailers/workarea/admin/status_report_mailer_test.rb
workarea-admin-3.4.16 test/mailers/workarea/admin/status_report_mailer_test.rb
workarea-admin-3.4.15 test/mailers/workarea/admin/status_report_mailer_test.rb
workarea-admin-3.4.14 test/mailers/workarea/admin/status_report_mailer_test.rb
workarea-admin-3.4.13 test/mailers/workarea/admin/status_report_mailer_test.rb
workarea-admin-3.4.12 test/mailers/workarea/admin/status_report_mailer_test.rb