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/routing/inspector_test.rb | 18 +++++++++--------- actionpack/test/dispatch/routing/ipv6_redirect_test.rb | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'actionpack/test/dispatch/routing') diff --git a/actionpack/test/dispatch/routing/inspector_test.rb b/actionpack/test/dispatch/routing/inspector_test.rb index 4686b53cab..07d0a8aefd 100644 --- a/actionpack/test/dispatch/routing/inspector_test.rb +++ b/actionpack/test/dispatch/routing/inspector_test.rb @@ -30,11 +30,11 @@ module ActionDispatch end end engine.routes.draw do - get "/cart", :to => "cart#show" + get "/cart", to: "cart#show" end output = draw do - get "/custom/assets", :to => "custom_assets#show" + get "/custom/assets", to: "custom_assets#show" mount engine => "/blog", :as => "blog" end @@ -71,7 +71,7 @@ module ActionDispatch def test_cart_inspect output = draw do - get "/cart", :to => "cart#show" + get "/cart", to: "cart#show" end assert_equal [ @@ -93,7 +93,7 @@ module ActionDispatch def test_inspect_shows_custom_assets output = draw do - get "/custom/assets", :to => "custom_assets#show" + get "/custom/assets", to: "custom_assets#show" end assert_equal [ @@ -122,7 +122,7 @@ module ActionDispatch def test_inspect_routes_shows_root_route output = draw do - root :to => "pages#main" + root to: "pages#main" end assert_equal [ @@ -160,7 +160,7 @@ module ActionDispatch def test_inspect_routes_shows_controller_and_action_route_with_constraints output = draw do ActiveSupport::Deprecation.silence do - get ":controller(/:action(/:id))", :id => /\d+/ + get ":controller(/:action(/:id))", id: /\d+/ end end @@ -172,7 +172,7 @@ module ActionDispatch def test_rails_routes_shows_route_with_defaults output = draw do - get "photos/:id" => "photos#show", :defaults => {:format => "jpg"} + get "photos/:id" => "photos#show", :defaults => {format: "jpg"} end assert_equal [ @@ -256,7 +256,7 @@ module ActionDispatch end output = draw do - scope :constraint => constraint.new do + scope constraint: constraint.new do mount MountedRackApp => "/foo" end end @@ -289,7 +289,7 @@ module ActionDispatch def test_redirect output = draw do - get "/foo" => redirect("/foo/bar"), :constraints => { :subdomain => "admin" } + get "/foo" => redirect("/foo/bar"), :constraints => { subdomain: "admin" } get "/bar" => redirect(path: "/foo/bar", status: 307) get "/foobar" => redirect{ "/foo/bar" } end diff --git a/actionpack/test/dispatch/routing/ipv6_redirect_test.rb b/actionpack/test/dispatch/routing/ipv6_redirect_test.rb index 866b492bad..b227aca658 100644 --- a/actionpack/test/dispatch/routing/ipv6_redirect_test.rb +++ b/actionpack/test/dispatch/routing/ipv6_redirect_test.rb @@ -7,17 +7,17 @@ class IPv6IntegrationTest < ActionDispatch::IntegrationTest class ::BadRouteRequestController < ActionController::Base include Routes.url_helpers def index - render :text => foo_path + render text: foo_path end def foo - redirect_to :action => :index + redirect_to action: :index end end Routes.draw do - get "/", :to => "bad_route_request#index", :as => :index - get "/foo", :to => "bad_route_request#foo", :as => :foo + get "/", to: "bad_route_request#index", as: :index + get "/foo", to: "bad_route_request#foo", as: :foo end def _routes -- cgit v1.2.3