aboutsummaryrefslogtreecommitdiffstats
path: root/spec/script/mailin-spec.rb
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-01-04 16:22:24 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-01-04 16:22:40 +1100
commit58defe7a49eda51676ffaa34ccf2b267d0e62159 (patch)
treef510d276e31f86abecab98d44282e1521c6916a0 /spec/script/mailin-spec.rb
parentc9c599daacc54dcba508fa5868e3aef928b5670d (diff)
parent185c09f98dc670881239ecd230e47fb2f214e53b (diff)
Merge remote-tracking branch 'mysociety/develop' into rails-3-spike
Conflicts: Gemfile.lock Rakefile app/controllers/request_controller.rb lib/tasks/rspec.rake spec/controllers/services_controller_spec.rb spec/spec_helper.rb spec/views/request/_after_actions.rhtml_spec.rb
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