From 5b6eb1d58b48fada298215b2cccda89f993890c3 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 6 Aug 2016 19:35:13 +0200 Subject: modernizes hash syntax in actionpack --- actionpack/test/controller/send_file_test.rb | 34 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'actionpack/test/controller/send_file_test.rb') 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 -- cgit v1.2.3