Commit 57cd2ff7 authored by Daniel DeLeo's avatar Daniel DeLeo
Browse files

Merge branch 'CHEF-2100' into 0.9-stable

parents 3f0799a9 9ea9d7b6
......@@ -81,7 +81,7 @@ class Chef
data.each do |field, values|
values.each do |v|
xml << FIELD_ATTR
xml << field
xml << xml_escape(field)
xml << FIELD_ATTR_END
xml << xml_escape(v)
xml << CLOSE_FIELD
......
......@@ -160,6 +160,14 @@ describe Chef::Solr do
@solr.solr_add(@data)
end
it "XML escapes keys before sending to SOLR" do
@data.delete("foo")
@data["foo&bar"] = ["baz"]
@solr.should_receive(:post_to_solr).with("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<add><doc><field name=\"foo&amp;bar\">baz</field></doc></add>\n")
@solr.solr_add(@data)
end
end
describe "solr_commit" do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment