aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/form_helper_test.rb
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/template/form_helper_test.rb
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/template/form_helper_test.rb')
-rw-r--r--actionpack/test/template/form_helper_test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index ff183d097d..fa0709179b 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -1,5 +1,6 @@
require 'abstract_unit'
require 'controller/fake_models'
+require 'active_support/core_ext/object/inclusion'
class FormHelperTest < ActionView::TestCase
tests ActionView::Helpers::FormHelper
@@ -1743,7 +1744,7 @@ class FormHelperTest < ActionView::TestCase
def snowman(method = nil)
txt = %{<div style="margin:0;padding:0;display:inline">}
txt << %{<input name="utf8" type="hidden" value="&#x2713;" />}
- if (method && !['get','post'].include?(method.to_s))
+ if method && !method.to_s.either?('get', 'post')
txt << %{<input name="_method" type="hidden" value="#{method}" />}
end
txt << %{</div>}