Sha256: 72e72b4746553cf651815d3f674e038860f0639902ba00a50582a244add7a57d

Contents?: true

Size: 1.13 KB

Versions: 6

Compression:

Stored size: 1.13 KB

Contents

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

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

  def test_subject
    mail = mail('three-uk-image-01.mail')
    mms = MMS2R::Media.new(mail)
    assert_equal "5551234", mms.number
    assert_equal "mms.three.co.uk", mms.carrier
    assert_equal "", mms.subject

    mms.purge
  end

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

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

    mms.purge
  end

  def test_default_media_should_return_user_generated_content
    mail = mail('three-uk-image-01.mail')
    mms = MMS2R::Media.new(mail)
    assert_equal "5551234", mms.number
    assert_equal "mms.three.co.uk", mms.carrier
    file = mms.default_media
    assert_equal '17102007.jpg', file.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_three_co_uk.rb
mms2r-3.3.0 test/test_mms_three_co_uk.rb
mms2r-3.2.0 test/test_mms_three_co_uk.rb
mms2r-3.1.0 test/test_mms_three_co_uk.rb
mms2r-3.0.1 test/test_mms_three_co_uk.rb
mms2r-3.0.0 test/test_mms_three_co_uk.rb