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.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb
index 4d201c7290..e78478b16c 100644
--- a/actionpack/test/controller/send_file_test.rb
+++ b/actionpack/test/controller/send_file_test.rb
@@ -28,9 +28,9 @@ class SendFileController < ActionController::Base
def test_send_file_headers_bang
options = {
- :type => Mime[:png],
- :disposition => "disposition",
- :filename => "filename"
+ type: Mime[:png],
+ disposition: "disposition",
+ filename: "filename"
}
send_data "foo", options
@@ -38,32 +38,32 @@ class SendFileController < ActionController::Base
def test_send_file_headers_with_disposition_as_a_symbol
options = {
- :type => Mime[:png],
- :disposition => :disposition,
- :filename => "filename"
+ type: Mime[:png],
+ disposition: :disposition,
+ filename: "filename"
}
send_data "foo", options
end
def test_send_file_headers_with_mime_lookup_with_symbol
- options = { :type => :png }
+ options = { type: :png }
send_data "foo", options
end
def test_send_file_headers_with_bad_symbol
- options = { :type => :this_type_is_not_registered }
+ options = { type: :this_type_is_not_registered }
send_data "foo", options
end
def test_send_file_headers_with_nil_content_type
- options = { :type => nil }
+ options = { type: nil }
send_data "foo", options
end
def test_send_file_headers_guess_type_from_extension
- options = { :filename => params[:filename] }
+ options = { filename: params[:filename] }
send_data "foo", options
end
@@ -84,7 +84,7 @@ class SendFileTest < ActionController::TestCase
end
def test_file_nostream
- @controller.options = { :stream => false }
+ @controller.options = { stream: false }
response = nil
assert_nothing_raised { response = process("file") }
assert_not_nil response
@@ -109,7 +109,7 @@ class SendFileTest < ActionController::TestCase
end
def test_file_url_based_filename
- @controller.options = { :url_based_filename => true }
+ @controller.options = { url_based_filename: true }
response = nil
assert_nothing_raised { response = process("file") }
assert_not_nil response
@@ -193,7 +193,7 @@ class SendFileTest < ActionController::TestCase
end
def test_send_file_without_content_disposition_header
- @controller.options = {:disposition => nil}
+ @controller.options = {disposition: nil}
process("data")
assert_nil @controller.headers["Content-Disposition"]
end
@@ -209,19 +209,19 @@ class SendFileTest < ActionController::TestCase
%w(file data).each do |method|
define_method "test_send_#{method}_status" do
- @controller.options = { :stream => false, :status => 500 }
+ @controller.options = { stream: false, status: 500 }
assert_not_nil process(method)
assert_equal 500, @response.status
end
define_method "test_send_#{method}_content_type" do
- @controller.options = { :stream => false, :content_type => "application/x-ruby" }
+ @controller.options = { stream: false, content_type: "application/x-ruby" }
assert_nothing_raised { assert_not_nil process(method) }
assert_equal "application/x-ruby", @response.content_type
end
define_method "test_default_send_#{method}_status" do
- @controller.options = { :stream => false }
+ @controller.options = { stream: false }
assert_nothing_raised { assert_not_nil process(method) }
assert_equal 200, @response.status
end
@@ -229,7 +229,7 @@ class SendFileTest < ActionController::TestCase
def test_send_file_with_action_controller_live
@controller = SendFileWithActionControllerLive.new
- @controller.options = { :content_type => "application/x-ruby" }
+ @controller.options = { content_type: "application/x-ruby" }
response = process("file")
assert_equal 200, response.status