Sha256: 085463e634f3dd474570b7e46bbb4cbbfa2be767365abc6756a1d4a1b6e79832

Contents?: true

Size: 1.09 KB

Versions: 10

Compression:

Stored size: 1.09 KB

Contents

require 'test_helper'

module Workarea
  class ApplicationMailerTest < MailerTest
    def test_from_address_changes
      order = create_placed_order

      Workarea.with_config do |config|
        original_email = 'noregerts@example.com'
        config.email_from = original_email
        control_mail = Storefront::OrderMailer.confirmation(order.id).deliver_now

        assert_equal([original_email], control_mail.from)
      end

      Workarea.with_config do |config|
        changed_email = 'changed@example.com'
        config.email_from = changed_email
        changed_mail = Storefront::OrderMailer.confirmation(order.id).deliver_now

        assert_equal([changed_email], changed_mail.from)
      end
    end

    def test_default_url_options
      @current_options = Rails.application.config.action_mailer.default_url_options.deep_dup
      Rails.application.config.action_mailer.default_url_options = { port: 12345 }

      assert_equal(12345, ApplicationMailer.new.default_url_options[:port])

    ensure
      Rails.application.config.action_mailer.default_url_options = @current_options
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/mailers/workarea/application_mailer_test.rb
workarea-core-3.5.26 test/mailers/workarea/application_mailer_test.rb
workarea-core-3.5.25 test/mailers/workarea/application_mailer_test.rb
workarea-core-3.5.23 test/mailers/workarea/application_mailer_test.rb
workarea-core-3.5.22 test/mailers/workarea/application_mailer_test.rb
workarea-core-3.5.21 test/mailers/workarea/application_mailer_test.rb
workarea-core-3.5.20 test/mailers/workarea/application_mailer_test.rb
workarea-core-3.5.19 test/mailers/workarea/application_mailer_test.rb
workarea-core-3.5.18 test/mailers/workarea/application_mailer_test.rb
workarea-core-3.5.17 test/mailers/workarea/application_mailer_test.rb