Sha256: d286ef59713e77ef02d8e1f9616d8e35842425b6b4b620b2be7a3a0c05830707

Contents?: true

Size: 1023 Bytes

Versions: 3

Compression:

Stored size: 1023 Bytes

Contents

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

class EmailAfterBeingDeliveredTest < ActiveSupport::TestCase
  def setup
    ActionMailer::Base.deliveries = []
    
    @email = new_email(
      :subject => 'Hello',
      :body => 'How are you?',
      :sender => create_email_address(:spec => 'webmaster@localhost'),
      :to => create_email_address(:spec => 'partners@localhost'),
      :cc => create_email_address(:spec => 'support@localhost'),
      :bcc => create_email_address(:spec => 'feedback@localhost')
    )
    assert @email.deliver
  end
  
  def test_should_send_mail
    assert ActionMailer::Base.deliveries.any?
    
    delivery = ActionMailer::Base.deliveries.first
    assert_equal 'Hello', delivery.subject
    assert_equal 'How are you?', delivery.body
    assert_equal ['webmaster@localhost'], delivery.from
    assert_equal ['partners@localhost'], delivery.to
    assert_equal ['support@localhost'], delivery.cc
    assert_equal ['feedback@localhost'], delivery.bcc
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
pluginaweek-has_emails-0.3.0 test/unit/email_test.rb
has_emails-0.3.1 test/unit/email_test.rb
has_emails-0.3.0 test/unit/email_test.rb