diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-10-11 14:39:59 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-10-11 14:39:59 +0100 |
commit | dd0c8d32c423998ab24409f8b4cab338b089d9a4 (patch) | |
tree | 929879b95c648e5711b4a8fd78111d22c19944fe | |
parent | a357a125317b97c13b53b55e3385fa75db458e13 (diff) |
Convert example url from comment into passing spec.
-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") |