Sha256: 44ab733f25980c3245d7e13f7d286fb4557b4446026d62efe26e76b63f9a8001

Contents?: true

Size: 1.07 KB

Versions: 3

Compression:

Stored size: 1.07 KB

Contents

require_relative 'test_helper'

class MailXSMTPAPI::AccessorsTest < Minitest::Test

  def test_to
    subject.to = 'a@example.com'
    assert_equal ['a@example.com'], subject.to
    subject.to << 'b@example.com'
    assert_equal ['a@example.com', 'b@example.com'], subject.to
  end

  def test_substitutions
    subject.substitutions['foo'] = ['bar']
    assert_equal ['bar'], subject.substitutions['foo']

    subject.merge_substitutions('foo', ['baz', 'qux'])
    assert_equal ['bar', 'baz', 'qux'], subject.substitutions['foo']
  end

  def test_unique_args
    subject.unique_args['foo'] = 'bar'
    assert_equal 'bar', subject.unique_args['foo']

    subject.unique_args = {'hello' => 'world'}
    refute subject.unique_args['foo']
    assert_equal 'world', subject.unique_args['hello']
  end

  def test_category
    subject.category = 'password_reset'
    assert_equal 'password_reset', subject.category
  end

  def test_asm_group_id
    subject.asm_group_id = 123
    assert_equal 123, subject.asm_group_id
  end

  private

  def subject
    @subject ||= MailXSMTPAPI::Field.new
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
mail-x_smtpapi-ksr-1.3.0 test/mail_accessors_test.rb
mail-x_smtpapi-1.2.0 test/mail_accessors_test.rb
mail-x_smtpapi-1.1.0 test/mail_accessors_test.rb