Permalink
Browse files

Use and pull out bcc_name bcc_email cc_name and cc_email

  • Loading branch information...
1 parent 964c647 commit b61a4243e4ed8c75ee1c55b638ce6fec847275c1 @r38y committed Apr 11, 2012
Showing with 32 additions and 0 deletions.
  1. +16 −0 lib/postmark/mitt.rb
  2. +16 −0 spec/postmark/mitt_spec.rb
View
@@ -35,10 +35,26 @@ def bcc
source["Bcc"]
end
+ def bcc_email
+ source["BccFull"]["Email"] || bcc
+ end
+
+ def bcc_name
+ source["BccFull"]["Name"] || bcc
+ end
+
def cc
source["Cc"]
end
+ def cc_email
+ source["CcFull"]["Email"] || cc
+ end
+
+ def cc_name
+ source["CcFull"]["Name"] || cc
+ end
+
def reply_to
source["ReplyTo"]
end
@@ -37,10 +37,26 @@
mitt.bcc.should == "FBI <hi@fbi.com>"
end
+ it "should pull out the bcc_email" do
+ mitt.bcc_email.should == "hi@fbi.com"
+ end
+
+ it "should pull out the bcc_name" do
+ mitt.bcc_name.should == "FBI"
+ end
+
it "should have a cc" do
mitt.cc.should == "Your Mom <hithere@hotmail.com>"
end
+ it "should pull out the cc_email" do
+ mitt.cc_email.should == "hithere@hotmail.com"
+ end
+
+ it "should pull out the cc_name" do
+ mitt.cc_name.should == "Your Mom"
+ end
+
it "should have a reply_to" do
mitt.reply_to.should == "new-comment+sometoken@yeah.com"
end

0 comments on commit b61a424

Please sign in to comment.