diff options
author | Elia Schito <elia@schito.me> | 2012-11-26 23:49:14 +0100 |
---|---|---|
committer | Elia Schito <elia@schito.me> | 2012-11-27 00:25:55 +0100 |
commit | 9c33cb26f409845cde5cd5f4298a94ac8a887f1d (patch) | |
tree | f64f02bcdd17fae1e633374b20003e037402e653 /actionpack/test | |
parent | 941f0196c6c8eade08bf19307bdbedaaeadbe291 (diff) | |
download | rails-9c33cb26f409845cde5cd5f4298a94ac8a887f1d.tar.gz rails-9c33cb26f409845cde5cd5f4298a94ac8a887f1d.tar.bz2 rails-9c33cb26f409845cde5cd5f4298a94ac8a887f1d.zip |
Accept symbols as #send_data :disposition value
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/send_file_test.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb index 8f885ff28e..4e4dd8d005 100644 --- a/actionpack/test/controller/send_file_test.rb +++ b/actionpack/test/controller/send_file_test.rb @@ -118,6 +118,18 @@ class SendFileTest < ActionController::TestCase assert_equal 'private', h['Cache-Control'] end + def test_send_file_headers_with_disposition_as_a_symbol + options = { + :type => Mime::PNG, + :disposition => :disposition, + :filename => 'filename' + } + + @controller.headers = {} + @controller.send(:send_file_headers!, options) + assert_equal 'disposition; filename="filename"', @controller.headers['Content-Disposition'] + end + def test_send_file_headers_with_mime_lookup_with_symbol options = { :type => :png @@ -138,7 +150,7 @@ class SendFileTest < ActionController::TestCase @controller.headers = {} assert_raise(ArgumentError){ @controller.send(:send_file_headers!, options) } end - + def test_send_file_headers_guess_type_from_extension { 'image.png' => 'image/png', |