Sha256: c470e512bc2805d5a46dd1f7c72391487d246e0e629717fc78149c3dfe43502e

Contents?: true

Size: 988 Bytes

Versions: 5

Compression:

Stored size: 988 Bytes

Contents

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

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

  def test_mms_uscc_net
    # mms.uscc.net service
    mail = mail('us-cellular-image-01.mail')
    mms = MMS2R::Media.new(mail)

    assert_equal "5418675309", mms.number
    assert_equal "mms.uscc.net", mms.carrier
    assert_equal "", mms.subject
    assert_equal 2, mms.media.size
    assert_nil mms.media['text/html']
    assert_nil mms.media['image/gif']

    assert_not_nil mms.media['image/jpeg']
    assert_equal 1, mms.media['image/jpeg'].size
    assert_match(/0315001513.jpg$/, mms.media['image/jpeg'].first)
    assert_file_size(mms.media['image/jpeg'].first, 337)

    assert_not_nil mms.media['text/plain']
    file = mms.media['text/plain'][0]
    assert_not_nil file
    assert_equal true, File::exist?(file)
    text = IO.readlines("#{file}").join
    assert_match(/This is what i do at work most the day/, text)

    mms.purge
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

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