aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/asset_debugging_test.rb2
-rw-r--r--railties/test/application/configuration_test.rb6
-rw-r--r--railties/test/application/generators_test.rb4
-rw-r--r--railties/test/application/loading_test.rb2
-rw-r--r--railties/test/application/middleware/cache_test.rb4
-rw-r--r--railties/test/application/middleware_test.rb2
-rw-r--r--railties/test/application/rake/migrations_test.rb2
-rw-r--r--railties/test/application/rake_test.rb32
-rw-r--r--railties/test/application/routing_test.rb2
9 files changed, 28 insertions, 28 deletions
diff --git a/railties/test/application/asset_debugging_test.rb b/railties/test/application/asset_debugging_test.rb
index ccecf2c09e..a732869d62 100644
--- a/railties/test/application/asset_debugging_test.rb
+++ b/railties/test/application/asset_debugging_test.rb
@@ -42,7 +42,7 @@ module ApplicationTests
test "assets are concatenated when debug is off and compile is off either if debug_assets param is provided" do
# config.assets.debug and config.assets.compile are false for production environment
ENV["RAILS_ENV"] = "production"
- output = Dir.chdir(app_path){ `bin/rails assets:precompile --trace 2>&1` }
+ output = Dir.chdir(app_path) { `bin/rails assets:precompile --trace 2>&1` }
assert $?.success?, output
# Load app env
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 94d3bbd165..5dceaae96b 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -1043,7 +1043,7 @@ module ApplicationTests
app "development"
- post "/posts", post: {"title" =>"zomg"}
+ post "/posts", post: { "title" =>"zomg" }
assert_equal "permitted", last_response.body
end
@@ -1067,7 +1067,7 @@ module ApplicationTests
assert_equal :raise, ActionController::Parameters.action_on_unpermitted_parameters
- post "/posts", post: {"title" =>"zomg"}
+ post "/posts", post: { "title" =>"zomg" }
assert_match "We're sorry, but something went wrong", last_response.body
end
@@ -1107,7 +1107,7 @@ module ApplicationTests
assert_equal :raise, ActionController::Parameters.action_on_unpermitted_parameters
- post "/posts", post: {"title" =>"zomg"}, format: "json"
+ post "/posts", post: { "title" =>"zomg" }, format: "json"
assert_equal 200, last_response.status
end
diff --git a/railties/test/application/generators_test.rb b/railties/test/application/generators_test.rb
index 0d7ccb2278..d4008fe677 100644
--- a/railties/test/application/generators_test.rb
+++ b/railties/test/application/generators_test.rb
@@ -29,7 +29,7 @@ module ApplicationTests
end
test "allow running plugin new generator inside Rails app directory" do
- FileUtils.cd(rails_root){ `ruby bin/rails plugin new vendor/plugins/bukkits` }
+ FileUtils.cd(rails_root) { `ruby bin/rails plugin new vendor/plugins/bukkits` }
assert File.exist?(File.join(rails_root, "vendor/plugins/bukkits/test/dummy/config/application.rb"))
end
@@ -165,7 +165,7 @@ module ApplicationTests
config.api_only = true
RUBY
- FileUtils.cd(rails_root){ `bin/rails generate mailer notifier foo` }
+ FileUtils.cd(rails_root) { `bin/rails generate mailer notifier foo` }
assert File.exist?(File.join(rails_root, "app/views/notifier_mailer/foo.text.erb"))
assert File.exist?(File.join(rails_root, "app/views/notifier_mailer/foo.html.erb"))
end
diff --git a/railties/test/application/loading_test.rb b/railties/test/application/loading_test.rb
index d57384d256..38f96f3ab9 100644
--- a/railties/test/application/loading_test.rb
+++ b/railties/test/application/loading_test.rb
@@ -298,7 +298,7 @@ class LoadingTest < ActiveSupport::TestCase
end
MIGRATION
- Dir.chdir(app_path) { `rake db:migrate`}
+ Dir.chdir(app_path) { `rake db:migrate` }
require "#{rails_root}/config/environment"
get "/title"
diff --git a/railties/test/application/middleware/cache_test.rb b/railties/test/application/middleware/cache_test.rb
index be44aa774f..cd1371359a 100644
--- a/railties/test/application/middleware/cache_test.rb
+++ b/railties/test/application/middleware/cache_test.rb
@@ -137,7 +137,7 @@ module ApplicationTests
body = last_response.body
etag = last_response.headers["ETag"]
- get "/expires/expires_etag", {private: true}, "If-None-Match" => etag
+ get "/expires/expires_etag", { private: true }, "If-None-Match" => etag
assert_equal "miss", last_response.headers["X-Rack-Cache"]
assert_not_equal body, last_response.body
end
@@ -171,7 +171,7 @@ module ApplicationTests
body = last_response.body
last = last_response.headers["Last-Modified"]
- get "/expires/expires_last_modified", {private: true}, "If-Modified-Since" => last
+ get "/expires/expires_last_modified", { private: true }, "If-Modified-Since" => last
assert_equal "miss", last_response.headers["X-Rack-Cache"]
assert_not_equal body, last_response.body
end
diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb
index 3b48ada190..1cc931b29e 100644
--- a/railties/test/application/middleware_test.rb
+++ b/railties/test/application/middleware_test.rb
@@ -103,7 +103,7 @@ module ApplicationTests
add_to_config "config.ssl_options = { host: 'example.com' }"
boot!
- assert_equal [{host: "example.com"}], Rails.application.middleware.first.args
+ assert_equal [{ host: "example.com" }], Rails.application.middleware.first.args
end
test "removing Active Record omits its middleware" do
diff --git a/railties/test/application/rake/migrations_test.rb b/railties/test/application/rake/migrations_test.rb
index d608fa1976..76cb302c62 100644
--- a/railties/test/application/rake/migrations_test.rb
+++ b/railties/test/application/rake/migrations_test.rb
@@ -57,7 +57,7 @@ module ApplicationTests
end
test "migration status when schema migrations table is not present" do
- output = Dir.chdir(app_path){ `bin/rails db:migrate:status 2>&1` }
+ output = Dir.chdir(app_path) { `bin/rails db:migrate:status 2>&1` }
assert_equal "Schema migrations table does not exist yet.\n", output
end
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb
index 5bb97a593d..5fd5507453 100644
--- a/railties/test/application/rake_test.rb
+++ b/railties/test/application/rake_test.rb
@@ -54,7 +54,7 @@ module ApplicationTests
Rails.application.initialize!
RUBY
- assert_match("SuperMiddleware", Dir.chdir(app_path){ `bin/rails middleware` })
+ assert_match("SuperMiddleware", Dir.chdir(app_path) { `bin/rails middleware` })
end
def test_initializers_are_executed_in_rake_tasks
@@ -69,7 +69,7 @@ module ApplicationTests
end
RUBY
- output = Dir.chdir(app_path){ `bin/rails do_nothing` }
+ output = Dir.chdir(app_path) { `bin/rails do_nothing` }
assert_match "Doing something...", output
end
@@ -128,7 +128,7 @@ module ApplicationTests
end
RUBY
- output = Dir.chdir(app_path){ `bin/rails routes` }
+ output = Dir.chdir(app_path) { `bin/rails routes` }
assert_equal "Prefix Verb URI Pattern Controller#Action\n cart GET /cart(.:format) cart#show\n", output
end
@@ -140,13 +140,13 @@ module ApplicationTests
end
RUBY
- output = Dir.chdir(app_path){ `bin/rails routes CONTROLLER=cart` }
+ output = Dir.chdir(app_path) { `bin/rails routes CONTROLLER=cart` }
assert_equal ["Passing `CONTROLLER` to `bin/rails routes` is deprecated and will be removed in Rails 5.1.",
"Please use `bin/rails routes -c controller_name` instead.",
"Prefix Verb URI Pattern Controller#Action",
" cart GET /cart(.:format) cart#show\n"].join("\n"), output
- output = Dir.chdir(app_path){ `bin/rails routes -c cart` }
+ output = Dir.chdir(app_path) { `bin/rails routes -c cart` }
assert_equal "Prefix Verb URI Pattern Controller#Action\n cart GET /cart(.:format) cart#show\n", output
end
@@ -167,10 +167,10 @@ module ApplicationTests
" PUT /admin/post(.:format) admin/posts#update",
" DELETE /admin/post(.:format) admin/posts#destroy\n"].join("\n")
- output = Dir.chdir(app_path){ `bin/rails routes -c Admin::PostController` }
+ output = Dir.chdir(app_path) { `bin/rails routes -c Admin::PostController` }
assert_equal expected_output, output
- output = Dir.chdir(app_path){ `bin/rails routes -c PostController` }
+ output = Dir.chdir(app_path) { `bin/rails routes -c PostController` }
assert_equal expected_output, output
end
@@ -183,13 +183,13 @@ module ApplicationTests
end
RUBY
- output = Dir.chdir(app_path){ `bin/rails routes -g show` }
+ output = Dir.chdir(app_path) { `bin/rails routes -g show` }
assert_equal "Prefix Verb URI Pattern Controller#Action\n cart GET /cart(.:format) cart#show\n", output
- output = Dir.chdir(app_path){ `bin/rails routes -g POST` }
+ output = Dir.chdir(app_path) { `bin/rails routes -g POST` }
assert_equal "Prefix Verb URI Pattern Controller#Action\n POST /cart(.:format) cart#create\n", output
- output = Dir.chdir(app_path){ `bin/rails routes -g basketballs` }
+ output = Dir.chdir(app_path) { `bin/rails routes -g basketballs` }
assert_equal " Prefix Verb URI Pattern Controller#Action\n" \
"basketballs GET /basketballs(.:format) basketball#index\n", output
end
@@ -202,13 +202,13 @@ module ApplicationTests
end
RUBY
- output = Dir.chdir(app_path){ `bin/rails routes -c cart` }
+ output = Dir.chdir(app_path) { `bin/rails routes -c cart` }
assert_equal "Prefix Verb URI Pattern Controller#Action\n cart GET /cart(.:format) cart#show\n", output
- output = Dir.chdir(app_path){ `bin/rails routes -c Cart` }
+ output = Dir.chdir(app_path) { `bin/rails routes -c Cart` }
assert_equal "Prefix Verb URI Pattern Controller#Action\n cart GET /cart(.:format) cart#show\n", output
- output = Dir.chdir(app_path){ `bin/rails routes -c CartController` }
+ output = Dir.chdir(app_path) { `bin/rails routes -c CartController` }
assert_equal "Prefix Verb URI Pattern Controller#Action\n cart GET /cart(.:format) cart#show\n", output
end
@@ -218,7 +218,7 @@ module ApplicationTests
end
RUBY
- assert_equal <<-MESSAGE.strip_heredoc, Dir.chdir(app_path){ `bin/rails routes` }
+ assert_equal <<-MESSAGE.strip_heredoc, Dir.chdir(app_path) { `bin/rails routes` }
You don't have any routes defined!
Please add some routes in config/routes.rb.
@@ -234,7 +234,7 @@ module ApplicationTests
end
RUBY
- output = Dir.chdir(app_path){ `bin/rake --rakefile Rakefile routes` }
+ output = Dir.chdir(app_path) { `bin/rake --rakefile Rakefile routes` }
assert_equal "Prefix Verb URI Pattern Controller#Action\n cart GET /cart(.:format) cart#show\n", output
end
@@ -247,7 +247,7 @@ module ApplicationTests
end
RUBY
- output = Dir.chdir(app_path){ `bin/rails log_something RAILS_ENV=production && cat log/production.log` }
+ output = Dir.chdir(app_path) { `bin/rails log_something RAILS_ENV=production && cat log/production.log` }
assert_match "Sample log message", output
end
diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb
index c70af162ae..c86759de5a 100644
--- a/railties/test/application/routing_test.rb
+++ b/railties/test/application/routing_test.rb
@@ -263,7 +263,7 @@ module ApplicationTests
assert_equal "WIN", last_response.body
end
- {"development" => "baz", "production" => "bar"}.each do |mode, expected|
+ { "development" => "baz", "production" => "bar" }.each do |mode, expected|
test "reloads routes when configuration is changed in #{mode}" do
controller :foo, <<-RUBY
class FooController < ApplicationController