Sha256: 62333a8e50260707e183549a5170e1c35f472485bc2ee2b28cf31eb4642a2a28

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

require File.dirname(__FILE__) + '/../test_helper'
require 'mail_notify'

class MailNotifyTest < Test::Unit::TestCase
  fixtures :elts, :mails, :attachments, :people, :users, :subscribers

  def setup
    ActionMailer::Base.delivery_method = :test
    ActionMailer::Base.perform_deliveries = true
    ActionMailer::Base.deliveries = []

    @expected = TMail::Mail.new
    @expected.set_content_type "text", "plain", { "charset" => CHARSET }
  end

	def test_deliver_mail
		ActionMailer::Base.deliveries = []

		assert_equal 0, ActionMailer::Base.deliveries.size

		elt = Elt.find('mailList')
		elt.publish

		assert_equal 1, ActionMailer::Base.deliveries.size
		assert_equal "mail@leparlement.org", ActionMailer::Base.deliveries[0].to[0]
	end

	def test_redeliver_mail
		ActionMailer::Base.deliveries = []

		assert_equal 0, ActionMailer::Base.deliveries.size

		elt = Elt.find('mailList')
		elt.publish

		assert_equal 1, ActionMailer::Base.deliveries.size
		assert_equal "mail@leparlement.org", ActionMailer::Base.deliveries[0].to[0]
		#puts ActionMailer::Base.deliveries[0].to
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
parlement-0.6 test/unit/mail_notify_test.rb
parlement-0.7 test/unit/mail_notify_test.rb
parlement-0.8 test/unit/mail_notify_test.rb
parlement-0.9 test/unit/mail_notify_test.rb