aboutsummaryrefslogtreecommitdiffstats
path: root/spec/script/mailin-spec.rb
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-01-15 17:04:06 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-01-15 17:04:06 +1100
commite6c80e93df44a436d9c94a9c076eb321df249b2a (patch)
treef2396181cfadeca370446f936f0bc4c1da3888dd /spec/script/mailin-spec.rb
parentb5f2bed1e406cd7fb6b50259a57be201c797db7d (diff)
parent843805e5d92eded943bd2a32b02ac967539245e8 (diff)
Merge remote-tracking branch 'mysociety/develop' into rails_xss
Diffstat (limited to 'spec/script/mailin-spec.rb')
-rw-r--r--spec/script/mailin-spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/script/mailin-spec.rb b/spec/script/mailin-spec.rb
new file mode 100644
index 000000000..d80789635
--- /dev/null
+++ b/spec/script/mailin-spec.rb
@@ -0,0 +1,21 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+require "external_command"
+
+def mailin_test(email_filename)
+ Dir.chdir Rails.root do
+ xc = ExternalCommand.new("script/mailin")
+ xc.run(load_file_fixture(email_filename))
+ xc.err.should == ""
+ return xc
+ end
+end
+
+describe "When importing mail into the application" do
+
+ it "should not produce any output and should return a 0 code on importing a plain email" do
+ r = mailin_test("incoming-request-plain.email")
+ r.status.should == 0
+ r.out.should == ""
+ end
+
+end \ No newline at end of file