diff options
-rw-r--r-- | app/models/incoming_message.rb | 1 | ||||
-rw-r--r-- | spec/models/incoming_message_spec.rb | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 113a06c55..c0fe8e52a 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -344,7 +344,6 @@ class IncomingMessage < ActiveRecord::Base name = Regexp.escape(self.info_request.user_name) # To end of message sections - # http://www.whatdotheyknow.com/request/university_investment_in_the_arm text.gsub!(/^#{name}[^\n]+\nSent by:[^\n]+\n.*/ims, "\n\n" + replacement) # Some other sort of forwarding quoting diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb index b7b88db59..b95cc83c4 100644 --- a/spec/models/incoming_message_spec.rb +++ b/spec/models/incoming_message_spec.rb @@ -132,6 +132,13 @@ end describe IncomingMessage, " folding quoted parts of emails" do + it 'should fold a plain text lotus notes quoted part correctly' do + text = "FOI Team\n\n\nInfo Requester <xxx@whatdotheyknow.com>=20\nSent by: Info Requester <request-bounce-xxxxx@whatdotheyknow.com>\n06/03/08 10:00\nPlease respond to\nInfo Requester <request-xxxx@whatdotheyknow.com>" + @incoming_message = IncomingMessage.new() + @incoming_message.stub_chain(:info_request, :user_name).and_return("Info Requester") + @incoming_message.remove_lotus_quoting(text).should match(/FOLDED_QUOTED_SECTION/) + end + it "cope with [ in user names properly" do @incoming_message = IncomingMessage.new() @incoming_message.stub_chain(:info_request, :user_name).and_return("Sir [ Bobble") |