Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for mms.ae and bump verison to 2.1.3
- Loading branch information
Showing
8 changed files
with
113 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
ignore: | ||
application/smil: | ||
- /^pres\.smil/i | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ class MMS2R::Media | |
## | ||
# MMS2R library version | ||
|
||
VERSION = '2.1.2' | ||
VERSION = '2.1.3' | ||
|
||
end | ||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Delivered-To: tommy.tutone@example.com | ||
Received: by 10.150.52.17 with SMTP id z17cs418249ybz; | ||
Sun, 19 Oct 2008 08:25:15 -0700 (PDT) | ||
Received: by 10.67.116.8 with SMTP id t8mr1482898ugm.57.1224429913824; | ||
Sun, 19 Oct 2008 08:25:13 -0700 (PDT) | ||
Return-Path: <+2068675309@mms.ae> | ||
Received: from domail2.emirates.net.ae (domail2.emirates.net.ae [213.42.1.94]) | ||
by mx.google.com with ESMTP id k27si2760421ugd.20.2008.10.19.08.25.12; | ||
Sun, 19 Oct 2008 08:25:13 -0700 (PDT) | ||
Received-SPF: softfail (google.com: domain of transitioning +2068675309@mms.ae does not designate 213.42.1.94 as permitted sender) client-ip=213.42.1.94; | ||
Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning +2068675309@mms.ae does not designate 213.42.1.94 as permitted sender) smtp.mail=+2068675309@mms.ae | ||
MIME-version: 1.0 | ||
Content-type: multipart/mixed; boundary="Boundary_(ID_p5dJ87KpgxrrG0Dfvu/kYQ)" | ||
Received: from dpmail4.emirates.net.ae ([213.42.3.217]) | ||
by domail2.emirates.net.ae (I&ES Mail Server 4.2) | ||
with ESMTP id <0K8Z00MO0S48DH00@domail2.emirates.net.ae> for | ||
tommy.tutone@example.com; Sun, 19 Oct 2008 19:24:08 +0400 (GST) | ||
Received: from mms.ae ([195.229.243.167]) by dpmail4.emirates.net.ae | ||
(I&ES Mail Server 4.2) with SMTP id <0K8Z00L51ASLJ320@dpmail4.emirates.net.ae> | ||
for tommy.tutone@example.com; Sun, 19 Oct 2008 19:24:24 +0400 (GST) | ||
Date: Sun, 19 Oct 2008 19:24:24 +0400 (GMT) | ||
From: +2068675309@mms.ae | ||
To: tommy.tutone@example.com | ||
Message-id: <48FB5115.006B87.11159@mmrl02> | ||
X-Mailer: HUAWEI EmailGateway 1.0 | ||
X-Mms-Message-ID: 101919242497100101339 | ||
X-Mms-Message-Class: Personal | ||
X-Mms-Priority: Normal | ||
|
||
|
||
--Boundary_(ID_p5dJ87KpgxrrG0Dfvu/kYQ) | ||
Content-type: image/jpeg; name=19102008.jpg | ||
Content-transfer-encoding: Base64 | ||
Content-disposition: inline; filename=19102008.jpg | ||
Content-Location: 19102008.jpg | ||
|
||
/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD//gAXQ3JlYXRl | ||
ZCB3aXRoIFRoZSBHSU1Q/9sAQwAFAwQEBAMFBAQEBQUFBgcMCAcHBwcPCwsJDBEPEhIRDxER | ||
ExYcFxMUGhURERghGBodHR8fHxMXIiQiHiQcHh8e/9sAQwEFBQUHBgcOCAgOHhQRFB4eHh4e | ||
Hh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e/8AAEQgAAQAB | ||
AwEiAAIRAQMRAf/EABUAAQEAAAAAAAAAAAAAAAAAAAAH/8QAFBABAAAAAAAAAAAAAAAAAAAA | ||
AP/EABUBAQEAAAAAAAAAAAAAAAAAAAcI/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQAC | ||
EQMRAD8AlgA6WW//2Q== | ||
|
||
--Boundary_(ID_p5dJ87KpgxrrG0Dfvu/kYQ)-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
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 TestMmsAe < Test::Unit::TestCase | ||
include MMS2R::TestHelper | ||
|
||
def test_only_valid_content_should_be_retained_for_mms_with_image_and_text | ||
mail = TMail::Mail.parse(load_mail('mms.ae-image-01.mail').join) | ||
mms = MMS2R::Media.new(mail) | ||
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 = TMail::Mail.parse(load_mail('mms.ae-image-01.mail').join) | ||
mms = MMS2R::Media.new(mail) | ||
number = mms.number() | ||
assert_equal number, "+2068675309" | ||
mms.purge | ||
end | ||
|
||
def test_subject_should_return_correct_subject | ||
mail = TMail::Mail.parse(load_mail('mms.ae-image-01.mail').join) | ||
mms = MMS2R::Media.new(mail) | ||
assert_equal "", mms.subject | ||
mms.purge | ||
end | ||
|
||
def test_attachment_should_return_jpeg | ||
mail = TMail::Mail.parse(load_mail('mms.ae-image-01.mail').join) | ||
mms = MMS2R::Media.new(mail) | ||
image = mms.default_media | ||
assert_equal 337, image.size | ||
assert_equal "19102008.jpg", image.original_filename | ||
mms.purge | ||
end | ||
|
||
end |