aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-06-14 10:05:06 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-06-14 10:05:06 +0100
commitb94bfb8540e56ae490ca3177688c63c3fad48696 (patch)
tree121726cd47e49732770eb6c6c0fe6c8097ed90fb
parent7c8465943e78cf723295bdef0ec7e397581ffabd (diff)
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)
-rwxr-xr-xscript/handle-mail-replies.rb2
-rw-r--r--spec/script/handle-mail-replies_spec.rb6
2 files changed, 7 insertions, 1 deletions
diff --git a/script/handle-mail-replies.rb b/script/handle-mail-replies.rb
index cc15fe35a..eba6f44cf 100755
--- a/script/handle-mail-replies.rb
+++ b/script/handle-mail-replies.rb
@@ -167,7 +167,7 @@ end
def load_rails
require File.join('config', 'boot')
- require Rails.root + '/config/environment'
+ require File.join('config', 'environment')
end
def record_bounce(email_address, bounce_message)
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