aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/info_request_spec.rb
diff options
context:
space:
mode:
authorMark Longair <mark@mysociety.org>2013-06-06 11:18:55 +0100
committerLouise Crow <louise.crow@gmail.com>2013-06-07 15:21:06 +0100
commit14a9d8383631e68e0349bef3aa3be623de7e0688 (patch)
treea7c4de77f603dcb6718602347e5ff430a255dc58 /spec/models/info_request_spec.rb
parent019ca9d0e64b3ec5f72431f732aee4195b7a5d93 (diff)
Cope with replying to a message with a missing or empty Subject
Conflicts: spec/models/info_request_spec.rb
Diffstat (limited to 'spec/models/info_request_spec.rb')
-rw-r--r--spec/models/info_request_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb
index 3eb88b2bb..9b87f909e 100644
--- a/spec/models/info_request_spec.rb
+++ b/spec/models/info_request_spec.rb
@@ -562,6 +562,18 @@ describe InfoRequest do
@info_request.prominence = 'requester_only'
@info_request.all_can_view?.should == false
end
+ end
+
+ describe 'when working out a subject for a followup emails' do
+
+ it "should not be confused by an nil subject in the incoming message" do
+ ir = info_requests(:fancy_dog_request)
+ im = mock_model(IncomingMessage,
+ :subject => nil,
+ :valid_to_reply_to? => true)
+ subject = ir.email_subject_followup im
+ subject.should match(/^Re: Freedom of Information request.*fancy dog/)
+ end
end