aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test/cases/format_test.rb
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-01-29 11:30:37 -0800
committerSantiago Pastorino <santiago@wyeworks.com>2012-01-29 11:30:37 -0800
commitdfa0c36204beb1b519962a6a49a1ebbed91015dd (patch)
tree2794ed0b8dd33458d2509ddd974519df9f561c8b /activeresource/test/cases/format_test.rb
parent677e06c20f6df6c44f44af9ba95390558e67a9bc (diff)
parentbf928bc7329640969917eb680da4de959b7156b7 (diff)
downloadrails-dfa0c36204beb1b519962a6a49a1ebbed91015dd.tar.gz
rails-dfa0c36204beb1b519962a6a49a1ebbed91015dd.tar.bz2
rails-dfa0c36204beb1b519962a6a49a1ebbed91015dd.zip
Merge pull request #4744 from ndbroadbent/replace_for_loops_with_enumerables
Replaced all 'for' loops with Enumerable#each
Diffstat (limited to 'activeresource/test/cases/format_test.rb')
-rw-r--r--activeresource/test/cases/format_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activeresource/test/cases/format_test.rb b/activeresource/test/cases/format_test.rb
index 21fdc24832..30342ecc74 100644
--- a/activeresource/test/cases/format_test.rb
+++ b/activeresource/test/cases/format_test.rb
@@ -19,7 +19,7 @@ class FormatTest < ActiveSupport::TestCase
end
def test_formats_on_single_element
- for format in [ :json, :xml ]
+ [ :json, :xml ].each do |format|
using_format(Person, format) do
ActiveResource::HttpMock.respond_to.get "/people/1.#{format}", {'Accept' => ActiveResource::Formats[format].mime_type}, ActiveResource::Formats[format].encode(@david)
assert_equal @david[:name], Person.find(1).name
@@ -28,7 +28,7 @@ class FormatTest < ActiveSupport::TestCase
end
def test_formats_on_collection
- for format in [ :json, :xml ]
+ [ :json, :xml ].each do |format|
using_format(Person, format) do
ActiveResource::HttpMock.respond_to.get "/people.#{format}", {'Accept' => ActiveResource::Formats[format].mime_type}, ActiveResource::Formats[format].encode(@programmers)
remote_programmers = Person.find(:all)
@@ -39,7 +39,7 @@ class FormatTest < ActiveSupport::TestCase
end
def test_formats_on_custom_collection_method
- for format in [ :json, :xml ]
+ [ :json, :xml ].each do |format|
using_format(Person, format) do
ActiveResource::HttpMock.respond_to.get "/people/retrieve.#{format}?name=David", {'Accept' => ActiveResource::Formats[format].mime_type}, ActiveResource::Formats[format].encode([@david])
remote_programmers = Person.get(:retrieve, :name => 'David')