aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models
diff options
context:
space:
mode:
authorfrancis <francis>2008-04-14 08:50:12 +0000
committerfrancis <francis>2008-04-14 08:50:12 +0000
commitd0784db3754b4fd32e9583220f89d89c3af490c0 (patch)
tree3e06e6d59aebad3842627be9410cd62ed41830ff /spec/models
parent537480328e0860e6284693af6418c6e95acb0d7a (diff)
Stop the wrapping code breaking up long URLs
Diffstat (limited to 'spec/models')
-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