aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2015-10-12 13:28:03 +0100
committerAndrew White <pixeltrix@users.noreply.github.com>2015-10-12 13:28:03 +0100
commitf39ab9f3436a498f08c14578f5ea67591150bf27 (patch)
tree6e2d219f576ba630f7081704dbe3de5621641641 /actionpack/test
parent96b1fbdeb1af9a3c843d1015a0acbdd30d26f2ff (diff)
parent218336fa54e864ae0b42c9b9cdaa7428a2f8688e (diff)
downloadrails-f39ab9f3436a498f08c14578f5ea67591150bf27.tar.gz
rails-f39ab9f3436a498f08c14578f5ea67591150bf27.tar.bz2
rails-f39ab9f3436a498f08c14578f5ea67591150bf27.zip
Merge pull request #21849 from yui-knk/refactor_regexp_to_string
Change `Journey::Route#verb` to return string instead of regexp.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/mapper_test.rb4
-rw-r--r--actionpack/test/dispatch/routing/inspector_test.rb11
2 files changed, 13 insertions, 2 deletions
diff --git a/actionpack/test/dispatch/mapper_test.rb b/actionpack/test/dispatch/mapper_test.rb
index f35ffd8845..e783df855e 100644
--- a/actionpack/test/dispatch/mapper_test.rb
+++ b/actionpack/test/dispatch/mapper_test.rb
@@ -82,7 +82,7 @@ module ActionDispatch
end
assert_equal({:omg=>:awesome, :controller=>"posts", :action=>"index"},
fakeset.defaults.first)
- assert_equal(/^GET$/, fakeset.routes.first.verb)
+ assert_equal("GET", fakeset.routes.first.verb)
end
def test_mapping_requirements
@@ -99,7 +99,7 @@ module ActionDispatch
mapper.scope(via: :put) do
mapper.match '/', :to => 'posts#index', :as => :main
end
- assert_equal(/^PUT$/, fakeset.routes.first.verb)
+ assert_equal("PUT", fakeset.routes.first.verb)
end
def test_map_slash
diff --git a/actionpack/test/dispatch/routing/inspector_test.rb b/actionpack/test/dispatch/routing/inspector_test.rb
index 24bd4b04ec..a17d07c40b 100644
--- a/actionpack/test/dispatch/routing/inspector_test.rb
+++ b/actionpack/test/dispatch/routing/inspector_test.rb
@@ -77,6 +77,17 @@ module ActionDispatch
], output
end
+ def test_articles_inspect_with_multiple_verbs
+ output = draw do
+ match 'articles/:id', to: 'articles#update', via: [:put, :patch]
+ end
+
+ assert_equal [
+ "Prefix Verb URI Pattern Controller#Action",
+ " PUT|PATCH /articles/:id(.:format) articles#update"
+ ], output
+ end
+
def test_inspect_shows_custom_assets
output = draw do
get '/custom/assets', :to => 'custom_assets#show'