Sha256: 737a6757f5a9c0d83cdd82ea754e77b2e37e7ff0785550e83d9ae44676a9798c

Contents?: true

Size: 1.59 KB

Versions: 1

Compression:

Stored size: 1.59 KB

Contents

require File.join(File.dirname(__FILE__), "..", "lib", "mms2r")
require File.join(File.dirname(__FILE__), "test_helper")
require 'test/unit'
require 'rubygems'
require 'mocha'
gem 'tmail', '>= 1.2.1'
require 'tmail'

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

  def test_mms_indosat_with_yahoo_service
    # mobile.indosat.net.id service
    mail = TMail::Mail.parse(load_mail('indosat-image-01.mail').join)
    mms = MMS2R::Media.new(mail)
    assert_equal "mobile.indosat.net.id", mms.carrier
    assert_equal "", mms.subject
    assert_nil mms.media['text/html']
    assert_equal 2, mms.media.size
    assert_not_nil mms.media['image/jpeg']
    assert_equal 1, mms.media['image/jpeg'].size
    assert_not_nil mms.media['image/jpeg'].first
    assert_match /Foto_14_.jpg/, mms.media['image/jpeg'].first
    assert_file_size(mms.media['image/jpeg'].first, 10022)
    assert_equal "Hello World", mms.default_text.read
    mms.purge
  end

  def test_mms_indosat
    # mobile.indosat.net.id service
    mail = TMail::Mail.parse(load_mail('indosat-image-02.mail').join)
    mms = MMS2R::Media.new(mail)
    assert_equal "mobile.indosat.net.id", mms.carrier
    assert_equal "Please pick up while I prepair another.", mms.subject
    assert_nil mms.media['text/html']
    assert_equal 1, mms.media.size
    assert_not_nil mms.media['image/jpeg']
    assert_equal 1, mms.media['image/jpeg'].size
    assert_not_nil mms.media['image/jpeg'].first
    assert_match /6033_small.jpeg/, mms.media['image/jpeg'].first
    assert_file_size(mms.media['image/jpeg'].first, 3684)
    mms.purge
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mms2r-2.0.1 test/test_mobile_indosat_net_id.rb