From 74d74416d145a49c04f62ec9659f1a564251c1b6 Mon Sep 17 00:00:00 2001 From: James McKinney Date: Mon, 2 Apr 2012 18:00:22 +0100 Subject: use Rails.root, not RAILS_ROOT --- spec/script/handle-mail-replies_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/script/handle-mail-replies_spec.rb') diff --git a/spec/script/handle-mail-replies_spec.rb b/spec/script/handle-mail-replies_spec.rb index 8ed83b31f..ad58ea565 100644 --- a/spec/script/handle-mail-replies_spec.rb +++ b/spec/script/handle-mail-replies_spec.rb @@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require "external_command" def mail_reply_test(email_filename) - Dir.chdir RAILS_ROOT do + Dir.chdir Rails.root do xc = ExternalCommand.new("script/handle-mail-replies", "--test") xc.run(load_file_fixture(email_filename)) -- cgit v1.2.3 From 89a640353f641c8b451bc22fcf4a68bd4dd1e886 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Mon, 30 Apr 2012 11:02:34 +0100 Subject: Recognise another variety of bounce message --- spec/script/handle-mail-replies_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/script/handle-mail-replies_spec.rb') diff --git a/spec/script/handle-mail-replies_spec.rb b/spec/script/handle-mail-replies_spec.rb index ad58ea565..0aa10323e 100644 --- a/spec/script/handle-mail-replies_spec.rb +++ b/spec/script/handle-mail-replies_spec.rb @@ -18,6 +18,12 @@ describe "When filtering" do r.out.should == "user@example.com\n" end + it "should detect a WebShield delivery error message" do + r = mail_reply_test("track-response-webshield-bounce.email") + r.status.should == 1 + r.out.should == "failed.user@example.co.uk\n" + end + it "should pass on a non-bounce message" do r = mail_reply_test("incoming-request-bad-uuencoding.email") r.status.should == 0 -- cgit v1.2.3 From c402c9aa3f96300eb1165364e6a0f1a50642297f Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Tue, 1 May 2012 18:19:05 +0100 Subject: Handle yet another style of bounce --- spec/script/handle-mail-replies_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/script/handle-mail-replies_spec.rb') diff --git a/spec/script/handle-mail-replies_spec.rb b/spec/script/handle-mail-replies_spec.rb index 0aa10323e..75a2aa6ad 100644 --- a/spec/script/handle-mail-replies_spec.rb +++ b/spec/script/handle-mail-replies_spec.rb @@ -24,6 +24,12 @@ describe "When filtering" do r.out.should == "failed.user@example.co.uk\n" end + it "should detect a MS Exchange non-permanent delivery error message" do + r = mail_reply_test("track-response-ms-bounce.email") + r.status.should == 1 + r.out.should == "" + end + it "should pass on a non-bounce message" do r = mail_reply_test("incoming-request-bad-uuencoding.email") r.status.should == 0 -- cgit v1.2.3 From b94bfb8540e56ae490ca3177688c63c3fad48696 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Thu, 14 Jun 2012 10:05:06 +0100 Subject: Fix bug that was preventing Rails from loading when *not* in test mode (exposed by the bug fixed in 7c846594 that was introduced in 775e122c) --- spec/script/handle-mail-replies_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/script/handle-mail-replies_spec.rb') diff --git a/spec/script/handle-mail-replies_spec.rb b/spec/script/handle-mail-replies_spec.rb index 75a2aa6ad..406af9ee3 100644 --- a/spec/script/handle-mail-replies_spec.rb +++ b/spec/script/handle-mail-replies_spec.rb @@ -12,6 +12,12 @@ def mail_reply_test(email_filename) end describe "When filtering" do + it "should not fail when not in test mode" do + xc = ExternalCommand.new("script/handle-mail-replies") + xc.run(load_file_fixture("track-response-exim-bounce.email")) + xc.err.should == "" + end + it "should detect an Exim bounce" do r = mail_reply_test("track-response-exim-bounce.email") r.status.should == 1 -- cgit v1.2.3