Sha256: e62d58892d6a8802f3f00359c72b28bc899872032511ed8909222463f433daff

Contents?: true

Size: 1.37 KB

Versions: 6

Compression:

Stored size: 1.37 KB

Contents

require File.join(File.dirname(__FILE__), "test_helper")

class TestMmsAe < Test::Unit::TestCase
  include MMS2R::TestHelper

  def test_only_valid_content_should_be_retained_for_mms_with_image_and_text
    mail = mail('mms.ae-image-01.mail')
    mms = MMS2R::Media.new(mail)
    assert_equal "+2068675309", mms.number
    assert_equal "mms.ae", mms.carrier
    assert_equal 1, mms.media.size
    assert_equal 1, mms.media['image/jpeg'].size
    assert_file_size(mms.media['image/jpeg'].first, 337)
    assert_match(/19102008.jpg$/, mms.media['image/jpeg'].first)
    mms.purge
  end

  def test_number_should_return_correct_number
    mail = mail('mms.ae-image-01.mail')
    mms = MMS2R::Media.new(mail)
    assert_equal "+2068675309", mms.number
    assert_equal "mms.ae", mms.carrier
    mms.purge
  end

  def test_subject_should_return_correct_subject
    mail = mail('mms.ae-image-01.mail')
    mms = MMS2R::Media.new(mail)
    assert_equal "+2068675309", mms.number
    assert_equal "mms.ae", mms.carrier
    assert_equal "", mms.subject
    mms.purge
  end

  def test_attachment_should_return_jpeg
    mail = mail('mms.ae-image-01.mail')
    mms = MMS2R::Media.new(mail)
    assert_equal "+2068675309", mms.number
    assert_equal "mms.ae", mms.carrier
    image = mms.default_media
    assert_equal 337, image.size
    assert_equal "19102008.jpg", image.original_filename
    mms.purge
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mms2r-3.3.1 test/test_mms_ae.rb
mms2r-3.3.0 test/test_mms_ae.rb
mms2r-3.2.0 test/test_mms_ae.rb
mms2r-3.1.0 test/test_mms_ae.rb
mms2r-3.0.1 test/test_mms_ae.rb
mms2r-3.0.0 test/test_mms_ae.rb