diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-11-04 14:55:59 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-12-18 14:03:47 +0000 |
commit | 2a76e61f6ca78a867e4a01589287ec76a5c8f4f7 (patch) | |
tree | c1b529f9bf3fa0417993041f8c458c192696be0c /spec/controllers/admin_raw_email_controller_spec.rb | |
parent | 148eb5e7e36a3e069d73a85188298d26bee1b220 (diff) |
Make downloading a raw email a RESTful route
Diffstat (limited to 'spec/controllers/admin_raw_email_controller_spec.rb')
-rw-r--r-- | spec/controllers/admin_raw_email_controller_spec.rb | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/spec/controllers/admin_raw_email_controller_spec.rb b/spec/controllers/admin_raw_email_controller_spec.rb index c1e939ee1..77c57c38b 100644 --- a/spec/controllers/admin_raw_email_controller_spec.rb +++ b/spec/controllers/admin_raw_email_controller_spec.rb @@ -4,9 +4,25 @@ describe AdminRawEmailController do describe :show do - it 'renders the show template' do - raw_email = FactoryGirl.create(:incoming_message).raw_email - get :show, :id => raw_email.id + 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 |