From 55f9b8129a50206513264824abb44088230793c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 16 Aug 2016 04:30:11 -0300 Subject: Add three new rubocop rules Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository. --- actionpack/test/dispatch/header_test.rb | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'actionpack/test/dispatch/header_test.rb') diff --git a/actionpack/test/dispatch/header_test.rb b/actionpack/test/dispatch/header_test.rb index 12f1c2712d..7a155d70cb 100644 --- a/actionpack/test/dispatch/header_test.rb +++ b/actionpack/test/dispatch/header_test.rb @@ -18,14 +18,14 @@ class HeaderTest < ActiveSupport::TestCase "HTTP_REFERER" => "/some/page", "Host" => "http://test.com") - assert_equal({"Content-Type" => "application/json", + assert_equal({ "Content-Type" => "application/json", "HTTP_REFERER" => "/some/page", - "Host" => "http://test.com"}, headers.env) + "Host" => "http://test.com" }, headers.env) end test "#env returns the headers as env variables" do - assert_equal({"CONTENT_TYPE" => "text/plain", - "HTTP_REFERER" => "/some/page"}, @headers.env) + assert_equal({ "CONTENT_TYPE" => "text/plain", + "HTTP_REFERER" => "/some/page" }, @headers.env) end test "#each iterates through the env variables" do @@ -105,28 +105,28 @@ class HeaderTest < ActiveSupport::TestCase test "#merge! headers with mutation" do @headers.merge!("Host" => "http://example.test", "Content-Type" => "text/html") - assert_equal({"HTTP_HOST" => "http://example.test", + assert_equal({ "HTTP_HOST" => "http://example.test", "CONTENT_TYPE" => "text/html", - "HTTP_REFERER" => "/some/page"}, @headers.env) + "HTTP_REFERER" => "/some/page" }, @headers.env) end test "#merge! env with mutation" do @headers.merge!("HTTP_HOST" => "http://first.com", "CONTENT_TYPE" => "text/html") - assert_equal({"HTTP_HOST" => "http://first.com", + assert_equal({ "HTTP_HOST" => "http://first.com", "CONTENT_TYPE" => "text/html", - "HTTP_REFERER" => "/some/page"}, @headers.env) + "HTTP_REFERER" => "/some/page" }, @headers.env) end test "merge without mutation" do combined = @headers.merge("HTTP_HOST" => "http://example.com", "CONTENT_TYPE" => "text/html") - assert_equal({"HTTP_HOST" => "http://example.com", + assert_equal({ "HTTP_HOST" => "http://example.com", "CONTENT_TYPE" => "text/html", - "HTTP_REFERER" => "/some/page"}, combined.env) + "HTTP_REFERER" => "/some/page" }, combined.env) - assert_equal({"CONTENT_TYPE" => "text/plain", - "HTTP_REFERER" => "/some/page"}, @headers.env) + assert_equal({ "CONTENT_TYPE" => "text/plain", + "HTTP_REFERER" => "/some/page" }, @headers.env) end test "env variables with . are not modified" do @@ -151,11 +151,11 @@ class HeaderTest < ActiveSupport::TestCase end test "headers directly modifies the passed environment" do - env = {"HTTP_REFERER" => "/"} + env = { "HTTP_REFERER" => "/" } headers = make_headers(env) headers["Referer"] = "http://example.com/" headers.merge! "CONTENT_TYPE" => "text/plain" - assert_equal({"HTTP_REFERER"=>"http://example.com/", - "CONTENT_TYPE"=>"text/plain"}, env) + assert_equal({ "HTTP_REFERER"=>"http://example.com/", + "CONTENT_TYPE"=>"text/plain" }, env) end end -- cgit v1.2.3