diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 19:35:13 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 19:35:13 +0200 |
commit | 5b6eb1d58b48fada298215b2cccda89f993890c3 (patch) | |
tree | a48010fd8c35588540f50df257a76347091aca12 /actionpack/test/dispatch/routing/inspector_test.rb | |
parent | 12a70404cd164008879e63cc320356e6afee3adc (diff) | |
download | rails-5b6eb1d58b48fada298215b2cccda89f993890c3.tar.gz rails-5b6eb1d58b48fada298215b2cccda89f993890c3.tar.bz2 rails-5b6eb1d58b48fada298215b2cccda89f993890c3.zip |
modernizes hash syntax in actionpack
Diffstat (limited to 'actionpack/test/dispatch/routing/inspector_test.rb')
-rw-r--r-- | actionpack/test/dispatch/routing/inspector_test.rb | 18 |
1 files changed, 9 insertions, 9 deletions
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 |