diff options
author | francis <francis> | 2009-04-21 10:18:22 +0000 |
---|---|---|
committer | francis <francis> | 2009-04-21 10:18:22 +0000 |
commit | ed3b240e211a56e38fc4c57d1fe6d7053f8fb47f (patch) | |
tree | ff2ce2ef6f84c75a2394509feb0ee5191affd062 /spec/models/incoming_message_spec.rb | |
parent | a6eb4edcfd9508c40ce80308a29791bd58b56897 (diff) |
Fix bug with not escaping name when used in regexp.
Diffstat (limited to 'spec/models/incoming_message_spec.rb')
-rw-r--r-- | spec/models/incoming_message_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb index d1738f6de..b84df3c0e 100644 --- a/spec/models/incoming_message_spec.rb +++ b/spec/models/incoming_message_spec.rb @@ -37,7 +37,26 @@ describe IncomingMessage, " display attachments" do foi_attachment.display_filename.should == expected_display_filename end +end + +describe IncomingMessage, " folding quoted parts of emails" do + + it "cope with [ in user names properly" do + @user = mock_model(User) + @user.stub!(:name).and_return("Sir [ Bobble") + @info_request = mock_model(InfoRequest) + @info_request.stub!(:user).and_return(@user) + + @incoming_message = IncomingMessage.new() + @incoming_message.info_request = @info_request + + # this gives a warning if [ is in the name + text = @incoming_message.remove_lotus_quoting("Sir [ Bobble \nSent by: \n") + text.should == "\n\nFOLDED_QUOTED_SECTION" + end end + + |