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/dispatch/response_test.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'actionpack/test/dispatch/response_test.rb') diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb index 24a17ca740..1efcd9e97f 100644 --- a/actionpack/test/dispatch/response_test.rb +++ b/actionpack/test/dispatch/response_test.rb @@ -221,23 +221,23 @@ class ResponseTest < ActiveSupport::TestCase end test "cookies" do - @response.set_cookie("user_name", :value => "david", :path => "/") + @response.set_cookie("user_name", value: "david", path: "/") _status, headers, _body = @response.to_a assert_equal "user_name=david; path=/", headers["Set-Cookie"] assert_equal({"user_name" => "david"}, @response.cookies) end test "multiple cookies" do - @response.set_cookie("user_name", :value => "david", :path => "/") - @response.set_cookie("login", :value => "foo&bar", :path => "/", :expires => Time.utc(2005, 10, 10,5)) + @response.set_cookie("user_name", value: "david", path: "/") + @response.set_cookie("login", value: "foo&bar", path: "/", expires: Time.utc(2005, 10, 10,5)) _status, headers, _body = @response.to_a assert_equal "user_name=david; path=/\nlogin=foo%26bar; path=/; expires=Mon, 10 Oct 2005 05:00:00 -0000", headers["Set-Cookie"] assert_equal({"login" => "foo&bar", "user_name" => "david"}, @response.cookies) end test "delete cookies" do - @response.set_cookie("user_name", :value => "david", :path => "/") - @response.set_cookie("login", :value => "foo&bar", :path => "/", :expires => Time.utc(2005, 10, 10,5)) + @response.set_cookie("user_name", value: "david", path: "/") + @response.set_cookie("login", value: "foo&bar", path: "/", expires: Time.utc(2005, 10, 10,5)) @response.delete_cookie("login") assert_equal({"user_name" => "david", "login" => nil}, @response.cookies) end @@ -254,7 +254,7 @@ class ResponseTest < ActiveSupport::TestCase assert resp.weak_etag? assert_not resp.strong_etag? assert_equal('W/"202cb962ac59075b964b07152d234b70"', resp.etag) - assert_equal({:public => true}, resp.cache_control) + assert_equal({public: true}, resp.cache_control) assert_equal("public", resp.headers["Cache-Control"]) assert_equal('W/"202cb962ac59075b964b07152d234b70"', resp.headers["ETag"]) @@ -461,7 +461,7 @@ class ResponseIntegrationTest < ActionDispatch::IntegrationTest assert_equal('W/"202cb962ac59075b964b07152d234b70"', @response.headers["ETag"]) assert_equal('W/"202cb962ac59075b964b07152d234b70"', @response.etag) - assert_equal({:public => true}, @response.cache_control) + assert_equal({public: true}, @response.cache_control) end test "response cache control from rackish app" do @@ -478,7 +478,7 @@ class ResponseIntegrationTest < ActionDispatch::IntegrationTest assert_equal('W/"202cb962ac59075b964b07152d234b70"', @response.headers["ETag"]) assert_equal('W/"202cb962ac59075b964b07152d234b70"', @response.etag) - assert_equal({:public => true}, @response.cache_control) + assert_equal({public: true}, @response.cache_control) end test "response charset and content type from railsish app" do -- cgit v1.2.3