solve360 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
@@ -2,7 +2,7 @@ require "httparty"
2
2
  require "configify"
3
3
  require "active_support/inflector"
4
4
  require "active_support/core_ext/hash"
5
-
5
+ require "cgi"
6
6
 
7
7
  ["item", "config", "contact", "company"].each do |lib|
8
8
  require File.join(File.dirname(__FILE__), "solve360", lib)
@@ -75,7 +75,7 @@ module Solve360
75
75
  def to_request
76
76
  xml = "<request>"
77
77
 
78
- xml << map_human_fields.collect {|key, value| "<#{key}>#{value}</#{key}>"}.join("")
78
+ xml << map_human_fields.collect {|key, value| "<#{key}>#{CGI.escapeHTML(value)}</#{key}>"}.join("")
79
79
 
80
80
  if related_items_to_add.size > 0
81
81
  xml << "<relateditems>"
@@ -204,7 +204,6 @@ describe "Finding all records" do
204
204
  end
205
205
 
206
206
  it "should contain all contacts" do
207
- puts @contacts.inspect
208
207
  @contacts.size.should == 2
209
208
  first = @contacts.first
210
209
  first.class.should == Solve360::Contact
@@ -224,4 +223,11 @@ describe "Handling errors" do
224
223
  @contact.save
225
224
  }.should raise_error(Solve360::SaveFailure)
226
225
  end
226
+ end
227
+
228
+ describe "CGI Converting values" do
229
+ it "should convert html entities" do
230
+ @contact = Solve360::Contact.new(:fields => {"First Name" => "Steve & Cat"})
231
+ @contact.to_request.should match(/Steve \&amp\; Cat/)
232
+ end
227
233
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 8
9
- version: 0.0.8
8
+ - 9
9
+ version: 0.0.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Stephen Bartholomew
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-17 00:00:00 +01:00
17
+ date: 2010-06-18 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency