aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-04-30 00:21:54 -0700
committerJosé Valim <jose.valim@gmail.com>2012-04-30 00:21:54 -0700
commitaa89bf78a209e5901d4417625048922b81d9eef1 (patch)
treee02aea094d772745c4485323b45d2bf1a2c1a010 /actionpack/test
parentc9cbc179e89043893ee37016a61c7a5ed90cde4f (diff)
parentcbb264e9fac39358c938fa172eb0f83ebd56b47d (diff)
downloadrails-aa89bf78a209e5901d4417625048922b81d9eef1.tar.gz
rails-aa89bf78a209e5901d4417625048922b81d9eef1.tar.bz2
rails-aa89bf78a209e5901d4417625048922b81d9eef1.zip
Merge pull request #6078 from lest/patch-4
allow send_file/send_data to skip disposition header, closes #2973
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/send_file_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb
index 3af17f495c..6fc3556e31 100644
--- a/actionpack/test/controller/send_file_test.rb
+++ b/actionpack/test/controller/send_file_test.rb
@@ -154,6 +154,17 @@ class SendFileTest < ActionController::TestCase
end
end
+ def test_send_file_with_default_content_disposition_header
+ process('data')
+ assert_equal 'attachment', @controller.headers['Content-Disposition']
+ end
+
+ def test_send_file_without_content_disposition_header
+ @controller.options = {:disposition => nil}
+ process('data')
+ assert_nil @controller.headers['Content-Disposition']
+ end
+
%w(file data).each do |method|
define_method "test_send_#{method}_status" do
@controller.options = { :stream => false, :status => 500 }