aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/send_file_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/send_file_test.rb')
-rw-r--r--actionpack/test/controller/send_file_test.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb
index c0ddcf7f50..fb9883fb18 100644
--- a/actionpack/test/controller/send_file_test.rb
+++ b/actionpack/test/controller/send_file_test.rb
@@ -143,7 +143,18 @@ class SendFileTest < ActionController::TestCase
}
@controller.headers = {}
- assert_raise(ArgumentError) { @controller.send(:send_file_headers!, options) }
+ error = assert_raise(ArgumentError) { @controller.send(:send_file_headers!, options) }
+ assert_equal "Unknown MIME type #{options[:type]}", error.message
+ end
+
+ def test_send_file_headers_with_nil_content_type
+ options = {
+ :type => nil
+ }
+
+ @controller.headers = {}
+ error = assert_raise(ArgumentError) { @controller.send(:send_file_headers!, options) }
+ assert_equal ":type option required", error.message
end
def test_send_file_headers_guess_type_from_extension