Skip to content

Instantly share code, notes, and snippets.

@libc
Created July 8, 2010 14:05
Show Gist options
  • Select an option

  • Save libc/468048 to your computer and use it in GitHub Desktop.

Select an option

Save libc/468048 to your computer and use it in GitHub Desktop.
diff --git a/lib/mail/fields/common/common_message_id.rb b/lib/mail/fields/common/common_message_id.rb
index 1223954..d25316d 100644
--- a/lib/mail/fields/common/common_message_id.rb
+++ b/lib/mail/fields/common/common_message_id.rb
@@ -18,7 +18,11 @@ module Mail
end
def message_ids
- element.message_ids
+ unless value.blank?
+ element.message_ids
+ else
+ []
+ end
end
def default
diff --git a/spec/mail/fields/in_reply_to_field_spec.rb b/spec/mail/fields/in_reply_to_field_spec.rb
index d230093..6eeb291 100644
--- a/spec/mail/fields/in_reply_to_field_spec.rb
+++ b/spec/mail/fields/in_reply_to_field_spec.rb
@@ -49,10 +49,14 @@ describe Mail::InReplyToField do
t = Mail::InReplyToField.new('<1234@test.lindsaar.net> <4567@test.lindsaar.net>')
t.decoded.should == '<1234@test.lindsaar.net>, <4567@test.lindsaar.net>'
end
-
+
+ it "should be able to handle an empty header" do
+ t = Mail::InReplyToField.new('')
+ t.decoded.should == ""
+ end
end
- describe "handlign multiple message ids" do
+ describe "handling multiple message ids" do
it "should handle many message IDs" do
t = Mail::InReplyToField.new('<1234@test.lindsaar.net> <4567@test.lindsaar.net>')
t.name.should == 'In-Reply-To'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment