Sha256: d358f2ab6b397b65b127f505b7543d944ccc0c7172c16d46b0b835dd3da7cbb9

Contents?: true

Size: 866 Bytes

Versions: 1

Compression:

Stored size: 866 Bytes

Contents

require 'test_helper'

class UserMailerTest < ActionController::TestCase
  context "UserMailer" do
    should "has sendgrid header" do
      assert UserMailer.sendgrid_config.to_hash["X-SMTPAPI"].present?
    end

    should "only send mail to the receiver" do
      UserMailer.notify("x@x.com").deliver
      assert UserMailer.sendgrid_config.to_hash["X-SMTPAPI"].include?("[\"x@x.com\"]")

      UserMailer.notify("y@y.com").deliver
      assert UserMailer.sendgrid_config.to_hash["X-SMTPAPI"].include?("[\"y@y.com\"]")
    end

    should "override subject by db tempate.subject" do
      @template = FactoryGirl.build(:system_mail_template_with_footer, :format => "html")
      assert_equal "subject in mailer", UserMailer.notify("x@x.com").subject
      @template.save
      assert_equal @template.subject, UserMailer.notify("x@x.com").subject
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mail_engine-0.1.4 test/functional/user_mailer_test.rb