aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/actionpack
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2016-08-16 04:30:11 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2016-08-16 04:30:11 -0300
commit55f9b8129a50206513264824abb44088230793c2 (patch)
treeff2f01cabfc7e74b0bd831c2272a5517e4e81e99 /actionview/test/actionpack
parentd0bdd74d7f6fae3d69b3681d5bc2d5ef6f55a0f8 (diff)
downloadrails-55f9b8129a50206513264824abb44088230793c2.tar.gz
rails-55f9b8129a50206513264824abb44088230793c2.tar.bz2
rails-55f9b8129a50206513264824abb44088230793c2.zip
Add three new rubocop rules
Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
Diffstat (limited to 'actionview/test/actionpack')
-rw-r--r--actionview/test/actionpack/abstract/abstract_controller_test.rb6
-rw-r--r--actionview/test/actionpack/controller/render_test.rb12
-rw-r--r--actionview/test/actionpack/controller/view_paths_test.rb2
3 files changed, 10 insertions, 10 deletions
diff --git a/actionview/test/actionpack/abstract/abstract_controller_test.rb b/actionview/test/actionpack/abstract/abstract_controller_test.rb
index b3dbf921b5..863efd15fa 100644
--- a/actionview/test/actionpack/abstract/abstract_controller_test.rb
+++ b/actionview/test/actionpack/abstract/abstract_controller_test.rb
@@ -37,7 +37,7 @@ module AbstractController
def render(options = {})
if options.is_a?(String)
- options = {_template_name: options}
+ options = { _template_name: options }
end
super
end
@@ -189,10 +189,10 @@ module AbstractController
private
def self.layout(formats)
- find_template(name.underscore, {formats: formats}, _prefixes: ["layouts"])
+ find_template(name.underscore, { formats: formats }, _prefixes: ["layouts"])
rescue ActionView::MissingTemplate
begin
- find_template("application", {formats: formats}, _prefixes: ["layouts"])
+ find_template("application", { formats: formats }, _prefixes: ["layouts"])
rescue ActionView::MissingTemplate
end
end
diff --git a/actionview/test/actionpack/controller/render_test.rb b/actionview/test/actionpack/controller/render_test.rb
index 453c2e75d6..cd89dceb45 100644
--- a/actionview/test/actionpack/controller/render_test.rb
+++ b/actionview/test/actionpack/controller/render_test.rb
@@ -186,12 +186,12 @@ class TestController < ApplicationController
def render_file_with_locals
path = File.join(File.dirname(__FILE__), "../../fixtures/test/render_file_with_locals")
- render file: path, locals: {secret: "in the sauce"}
+ render file: path, locals: { secret: "in the sauce" }
end
def render_file_as_string_with_locals
path = File.expand_path(File.join(File.dirname(__FILE__), "../../fixtures/test/render_file_with_locals"))
- render file: path, locals: {secret: "in the sauce"}
+ render file: path, locals: { secret: "in the sauce" }
end
def accessing_request_in_template
@@ -249,7 +249,7 @@ class TestController < ApplicationController
end
def render_line_offset
- render inline: "<% raise %>", locals: {foo: "bar"}
+ render inline: "<% raise %>", locals: { foo: "bar" }
end
def heading
@@ -593,7 +593,7 @@ class TestController < ApplicationController
end
def partial_with_hash_object
- render partial: "hash_object", object: {first_name: "Sam"}
+ render partial: "hash_object", object: { first_name: "Sam" }
end
def partial_with_nested_object
@@ -605,11 +605,11 @@ class TestController < ApplicationController
end
def partial_hash_collection
- render partial: "hash_object", collection: [ {first_name: "Pratik"}, {first_name: "Amy"} ]
+ render partial: "hash_object", collection: [ { first_name: "Pratik" }, { first_name: "Amy" } ]
end
def partial_hash_collection_with_locals
- render partial: "hash_greeting", collection: [ {first_name: "Pratik"}, {first_name: "Amy"} ], locals: { greeting: "Hola" }
+ render partial: "hash_greeting", collection: [ { first_name: "Pratik" }, { first_name: "Amy" } ], locals: { greeting: "Hola" }
end
def partial_with_implicit_local_assignment
diff --git a/actionview/test/actionpack/controller/view_paths_test.rb b/actionview/test/actionpack/controller/view_paths_test.rb
index 9471c76921..4c58b959a9 100644
--- a/actionview/test/actionpack/controller/view_paths_test.rb
+++ b/actionview/test/actionpack/controller/view_paths_test.rb
@@ -34,7 +34,7 @@ class ViewLoadPathsTest < ActionController::TestCase
end
def expand(array)
- array.map {|x| File.expand_path(x.to_s)}
+ array.map { |x| File.expand_path(x.to_s) }
end
def assert_paths(*paths)