aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/admin_raw_email_controller_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-12-18 15:42:53 +0000
committerLouise Crow <louise.crow@gmail.com>2014-12-18 15:42:53 +0000
commitbbdcb09cb9eeb94e3244a22b1129a1e9521947f4 (patch)
tree4ad15f4138796087c32957261e8b9e7b6f59887b /spec/controllers/admin_raw_email_controller_spec.rb
parent5cfcdaac505e60914ee4398cfe431bd5d21b58ed (diff)
parentabdc92fd922dd82da85f7c00bdb50e85ed047714 (diff)
Merge branch 'restful-admin-routes' into rails-3-develop
Diffstat (limited to 'spec/controllers/admin_raw_email_controller_spec.rb')
-rw-r--r--spec/controllers/admin_raw_email_controller_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/controllers/admin_raw_email_controller_spec.rb b/spec/controllers/admin_raw_email_controller_spec.rb
new file mode 100644
index 000000000..77c57c38b
--- /dev/null
+++ b/spec/controllers/admin_raw_email_controller_spec.rb
@@ -0,0 +1,30 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe AdminRawEmailController do
+
+ describe :show do
+
+ before do
+ @raw_email = FactoryGirl.create(:incoming_message).raw_email
+ end
+
+ describe 'html version' do
+
+ it 'renders the show template' do
+ get :show, :id => @raw_email.id
+ end
+
+ end
+
+ describe 'text version' do
+
+ it 'sends the email as an RFC-822 attachment' do
+ get :show, :id => @raw_email.id, :format => 'txt'
+ response.content_type.should == 'message/rfc822'
+ response.body.should == @raw_email.data
+ end
+ end
+
+ end
+
+end