aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/admin_raw_email_controller_spec.rb
diff options
context:
space:
mode:
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