diff options
author | francis <francis> | 2009-10-04 21:53:53 +0000 |
---|---|---|
committer | francis <francis> | 2009-10-04 21:53:53 +0000 |
commit | 1890f41864adf2b6945a66636fbc2772b9f018cd (patch) | |
tree | d560a139fe7b87d9a46ba9ae41c169a9816d5117 /spec/models | |
parent | 661e12a398e5b081abf4a6232498eb20a20eaf72 (diff) |
Move the actual messages sent to authorities into a separate mailer model class (so can give them different layout, but is nice anyhow)
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/request_mailer_spec.rb | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/spec/models/request_mailer_spec.rb b/spec/models/request_mailer_spec.rb index d097e0ec5..904f41934 100644 --- a/spec/models/request_mailer_spec.rb +++ b/spec/models/request_mailer_spec.rb @@ -151,72 +151,6 @@ And a paragraph afterwards." end -describe RequestMailer, " when working out follow up addresses" do - # This is done with fixtures as the code is a bit tangled with the way it - # calls TMail. XXX untangle it and make these tests spread out and using - # mocks. Put parts of the tests in spec/lib/tmail_extensions.rb - fixtures :info_requests, :incoming_messages, :raw_emails, :public_bodies - - it "should parse them right" do - ir = info_requests(:fancy_dog_request) - im = ir.incoming_messages[0] - - # check the basic entry in the fixture is fine - RequestMailer.name_and_email_for_followup(ir, im).should == "FOI Person <foiperson@localhost>" - RequestMailer.name_for_followup(ir, im).should == "FOI Person" - RequestMailer.email_for_followup(ir, im).should == "foiperson@localhost" - end - - it "should work when there is only an email address" do - ir = info_requests(:fancy_dog_request) - im = ir.incoming_messages[0] - - im.raw_email.data.sub!("\"FOI Person\" <foiperson@localhost>", "foiperson@localhost") - - # check the basic entry in the fixture is fine - RequestMailer.name_and_email_for_followup(ir, im).should == "foiperson@localhost" - RequestMailer.name_for_followup(ir, im).should == "The Geraldine Quango" - RequestMailer.email_for_followup(ir, im).should == "foiperson@localhost" - end - - it "should quote funny characters" do - ir = info_requests(:fancy_dog_request) - im = ir.incoming_messages[0] - - im.raw_email.data.sub!("FOI Person", "FOI [ Person") - - # check the basic entry in the fixture is fine - RequestMailer.name_and_email_for_followup(ir, im).should == "\"FOI [ Person\" <foiperson@localhost>" - RequestMailer.name_for_followup(ir, im).should == "FOI [ Person" - RequestMailer.email_for_followup(ir, im).should == "foiperson@localhost" - end - - it "should quote quotes" do - ir = info_requests(:fancy_dog_request) - im = ir.incoming_messages[0] - - im.raw_email.data.sub!("FOI Person", "FOI \\\" Person") - - # check the basic entry in the fixture is fine - RequestMailer.name_and_email_for_followup(ir, im).should == "\"FOI \\\" Person\" <foiperson@localhost>" - RequestMailer.name_for_followup(ir, im).should == "FOI \" Person" - RequestMailer.email_for_followup(ir, im).should == "foiperson@localhost" - end - - it "should quote @ signs" do - ir = info_requests(:fancy_dog_request) - im = ir.incoming_messages[0] - - im.raw_email.data.sub!("FOI Person", "FOI @ Person") - - # check the basic entry in the fixture is fine - RequestMailer.name_and_email_for_followup(ir, im).should == "\"FOI @ Person\" <foiperson@localhost>" - RequestMailer.name_for_followup(ir, im).should == "FOI @ Person" - RequestMailer.email_for_followup(ir, im).should == "foiperson@localhost" - end - -end - describe RequestMailer, "when sending reminders to requesters to classify a response to their request" do before do |