diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-10-07 14:53:07 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-10-07 14:53:07 +0100 |
commit | 8fef5dffbef6455dd08beb7d6b1910737a9e1614 (patch) | |
tree | 0244a016c0ebd568d8c6f8b53fb4c52fa08b7cca | |
parent | 6841ed78634c7640662e4ff91ec0ed97f86e8988 (diff) | |
parent | b764f129a17e2b5781834aa76c92eaae7105f3f0 (diff) |
Merge branch 'feature/email-subject-cleanup' into rails-3-develop
-rw-r--r-- | app/models/info_request.rb | 10 | ||||
-rw-r--r-- | spec/models/info_request_spec.rb | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index aaced91a2..eba620f53 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -271,15 +271,9 @@ public # Subject lines for emails about the request def email_subject_request - # XXX pull out this general_register_office specialisation - # into some sort of separate jurisdiction dependent file - if self.public_body.url_name == 'general_register_office' - # without GQ in the subject, you just get an auto response - _('{{law_used_full}} request GQ - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title.html_safe) - else - _('{{law_used_full}} request - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title.html_safe) - end + _('{{law_used_full}} request - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title.html_safe) end + def email_subject_followup(incoming_message = nil) if incoming_message.nil? || !incoming_message.valid_to_reply_to? || !incoming_message.subject 'Re: ' + self.email_subject_request diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index 7281b74b6..64ad1972e 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -770,6 +770,16 @@ describe InfoRequest do end end + describe 'when working out a subject for request emails' do + + it 'should create a standard request subject' do + info_request = FactoryGirl.build(:info_request) + expected_text = "Freedom of Information request - #{info_request.title}" + info_request.email_subject_request.should == expected_text + 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 |