Skip to content

Commit a058957

Browse files
committed
Remove test for XML YAML parsing
The support for YAML parsing in XML has been removed from Active Support since it introduced an security risk. See http://goo.gl/Dak4R for more detail.
1 parent 00048f7 commit a058957

File tree

2 files changed

+3
-30
lines changed

2 files changed

+3
-30
lines changed

test/abstract_unit.rb

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,34 +81,20 @@ def setup_response
8181
:mother => {:name => 'Ingeborg'}
8282
}
8383
}.to_json
84-
# - resource with yaml array of strings; for ARs using serialize :bar, Array
85-
@marty = <<-eof.strip
86-
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
87-
<person>
88-
<id type=\"integer\">5</id>
89-
<name>Marty</name>
90-
<colors type=\"yaml\">---
91-
- \"red\"
92-
- \"green\"
93-
- \"blue\"
94-
</colors>
95-
</person>
96-
eof
9784

9885
@startup_sound = {
9986
:sound => {
10087
:name => "Mac Startup Sound", :author => { :name => "Jim Reekes" }
10188
}
10289
}.to_json
103-
90+
10491
@product = {id: 1, name: 'Rails book'}.to_json
10592
@inventory = {status: 'Sold Out', total: 10, used: 10}.to_json
10693

10794
ActiveResource::HttpMock.respond_to do |mock|
10895
mock.get "/people/1.json", {}, @matz
10996
mock.get "/people/1.xml", {}, @matz_xml
11097
mock.get "/people/2.xml", {}, @david
111-
mock.get "/people/5.xml", {}, @marty
11298
mock.get "/people/Greg.json", {}, @greg
11399
mock.get "/people/6.json", {}, @joe
114100
mock.get "/people/4.json", { 'key' => 'value' }, nil, 404

test/cases/base_test.rb

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ def test_build_without_attributes_for_prefix_call
672672
end
673673
assert_raise(ActiveResource::InvalidRequestError) { StreetAddress.build }
674674
end
675-
675+
676676
def test_build_with_attributes_for_prefix_call
677677
ActiveResource::HttpMock.respond_to do |mock|
678678
mock.get "/people/1/addresses/new.json", {}, StreetAddress.new.to_json
@@ -1205,26 +1205,13 @@ def test_parse_resources_with_has_many_makes_get_request_on_nested_route
12051205
assert_kind_of Comment, comment
12061206
end
12071207
end
1208-
1208+
12091209
def test_parse_resource_with_has_one_makes_get_request_on_child_route
12101210
Product.send(:has_one, :inventory)
12111211
product = Product.find(1)
12121212
assert product.inventory.status == ActiveSupport::JSON.decode(@inventory)['status']
12131213
end
12141214

1215-
def test_load_yaml_array
1216-
assert_nothing_raised do
1217-
Person.format = :xml
1218-
marty = Person.find(5)
1219-
assert_equal 3, marty.colors.size
1220-
marty.colors.each do |color|
1221-
assert_kind_of String, color
1222-
end
1223-
end
1224-
ensure
1225-
Person.format = :json
1226-
end
1227-
12281215
def test_with_custom_formatter
12291216
addresses = [{ :id => "1", :street => "1 Infinite Loop", :city => "Cupertino", :state => "CA" }].to_xml(:root => :addresses)
12301217

0 commit comments

Comments
 (0)