aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2011-04-11 00:52:42 +0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2011-04-11 03:17:09 +0800
commita9f3c9da01d721963d05949604ead909aaabbf36 (patch)
tree5e278655997e1dcf86d9e0ee2f6be30d323fc8b4 /actionpack/test/dispatch
parent635d991683c439da56fa72853880e88e6ac291ed (diff)
downloadrails-a9f3c9da01d721963d05949604ead909aaabbf36.tar.gz
rails-a9f3c9da01d721963d05949604ead909aaabbf36.tar.bz2
rails-a9f3c9da01d721963d05949604ead909aaabbf36.zip
Using Object#in? and Object#either? in various places
There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/routing_test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index 5e5758a60e..51355b3ac7 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -1,6 +1,7 @@
require 'erb'
require 'abstract_unit'
require 'controller/fake_controllers'
+require 'active_support/core_ext/object/inclusion'
class TestRoutingMapper < ActionDispatch::IntegrationTest
SprocketsApp = lambda { |env|
@@ -495,7 +496,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
resources :todos, :id => /\d+/
end
- scope '/countries/:country', :constraints => lambda { |params, req| %[all France].include?(params[:country]) } do
+ scope '/countries/:country', :constraints => lambda { |params, req| params[:country].either?("all", "france") } do
match '/', :to => 'countries#index'
match '/cities', :to => 'countries#cities'
end