aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/request_mailer_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/request_mailer_spec.rb')
-rw-r--r--spec/models/request_mailer_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/request_mailer_spec.rb b/spec/models/request_mailer_spec.rb
index cccd91a35..03d4c464b 100644
--- a/spec/models/request_mailer_spec.rb
+++ b/spec/models/request_mailer_spec.rb
@@ -20,10 +20,22 @@ describe RequestMailer, " when receiving incoming mail" do
ir.incoming_messages.size.should == 1
deliveries = ActionMailer::Base.deliveries
+ #raise deliveries[1].body
deliveries.size.should == 1
mail = deliveries[0]
mail.to.should == [ MySociety::Config.get("CONTACT_EMAIL", 'contact@localhost') ]
end
+
+ it "should not mutilate long URLs when trying to word wrap them" do
+ long_url = 'http://www.this.is.quite.a.long.url.flourish.org/there.is.no.way.it.is.short.whatsoever'
+ body = "This is a message with quite a long URL in it. It also has a paragraph, being this one that has quite a lot of text in it to. Enough to test the wrapping of itself.
+
+#{long_url}
+
+And a paragraph afterwards."
+ wrapped = MySociety::Format.wrap_email_body(body)
+ wrapped.should include(long_url)
+ end
end