Sha256: 6e9684017d3705c9b486e5611cb6c76d912dc3f2b362bc8841ffb53dcbb2425e

Contents?: true

Size: 1.49 KB

Versions: 17

Compression:

Stored size: 1.49 KB

Contents

require "test_helper"

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

  def test_subject
    mail = mail('netcom-image-01.mail')
    mms = MMS2R::Media.new(mail)
    assert_equal "5551234", mms.number
    assert_equal "mms.netcom.no", mms.carrier
    assert_equal "Morning greetings from norway. This is a", mms.subject

    mms.purge
  end

  def test_image
    mail = mail('netcom-image-01.mail')
    mms = MMS2R::Media.new(mail)
    assert_equal "5551234", mms.number
    assert_equal "mms.netcom.no", mms.carrier

    assert_equal 2, mms.media.size
    assert_not_nil mms.media['text/plain']
    assert_equal 1, mms.media['text/plain'].size
    assert_not_nil mms.media['image/jpeg']
    assert_equal 1, mms.media['image/jpeg'].size
    assert_file_size mms.media['image/jpeg'].first, 337

    mms.purge
  end

  def test_default_media_should_return_user_generated_content
    mail = mail('netcom-image-01.mail')
    mms = MMS2R::Media.new(mail)
    assert_equal "5551234", mms.number
    assert_equal "mms.netcom.no", mms.carrier
    file = mms.default_media
    assert_equal 337, file.size

    mms.purge
  end

  def test_default_text_should_return_user_generated_content
    mail = mail('netcom-image-01.mail')
    mms = MMS2R::Media.new(mail)
    assert_equal "5551234", mms.number
    assert_equal "mms.netcom.no", mms.carrier
    file = mms.default_text
    assert_equal "Morning greetings from norway. This is a mms from norwegian carrier netcom.", file.read

    mms.purge
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mms2r-3.9.2 test/test_mms_netcom_no.rb
mms2r-3.9.1 test/test_mms_netcom_no.rb
mms2r-3.9.0 test/test_mms_netcom_no.rb
mms2r-3.8.2 test/test_mms_netcom_no.rb
mms2r-3.8.1 test/test_mms_netcom_no.rb
mms2r-3.8.0 test/test_mms_netcom_no.rb
mms2r-3.7.1 test/test_mms_netcom_no.rb
mms2r-3.7.0 test/test_mms_netcom_no.rb
mms2r-3.6.4 test/test_mms_netcom_no.rb
mms2r-3.6.3 test/test_mms_netcom_no.rb
mms2r-3.6.2 test/test_mms_netcom_no.rb
mms2r-3.6.1 test/test_mms_netcom_no.rb
mms2r-3.6.0 test/test_mms_netcom_no.rb
mms2r-3.5.1 test/test_mms_netcom_no.rb
mms2r-3.5.0 test/test_mms_netcom_no.rb
mms2r-3.4.1 test/test_mms_netcom_no.rb
mms2r-3.4.0 test/test_mms_netcom_no.rb