Sha256: 0dfd957684e76f6d4595896f9a5d1f1a00a43fd44f7ed12b774ccfce78bcd2e0

Contents?: true

Size: 658 Bytes

Versions: 1

Compression:

Stored size: 658 Bytes

Contents

module RedminePluginsHelper
  class TestConfig
    def before_each
      mailer_setup
    end

    def after_each
      mailer_teadown
    end

    def mailer_setup
      unless @mailer_perform_deliveries_changed
        @mailer_perform_deliveries_changed = true
        @mailer_perform_deliveries_was_enabled = ::ActionMailer::Base.perform_deliveries
      end
      ::ActionMailer::Base.perform_deliveries = false
    end

    def mailer_teadown
      return unless @mailer_perform_deliveries_changed

      ::ActionMailer::Base.perform_deliveries = @mailer_perform_deliveries_was_enabled
      @mailer_perform_deliveries_changed = false
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
redmine_plugins_helper-0.7.0 lib/redmine_plugins_helper/test_config.rb