Skip to content

Commit

Permalink
Added debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Bartholomew committed Jun 18, 2010
1 parent ddbe09c commit 0c3f883
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.0.9
0.0.11
5 changes: 5 additions & 0 deletions lib/solve360.rb
Expand Up @@ -9,6 +9,11 @@
end

module Solve360
def self.debug
Company.debug_output
Contact.debug_output
end

class SaveFailure < Exception
end
end
2 changes: 1 addition & 1 deletion lib/solve360/item.rb
Expand Up @@ -75,7 +75,7 @@ def new_record?
def to_request
xml = "<request>"

xml << map_human_fields.collect {|key, value| "<#{key}>#{CGI.escapeHTML(value)}</#{key}>"}.join("")
xml << map_human_fields.collect {|key, value| "<#{key}>#{CGI.escapeHTML(value.to_s)}</#{key}>"}.join("")

if related_items_to_add.size > 0
xml << "<relateditems>"
Expand Down
2 changes: 1 addition & 1 deletion solve360.gemspec
Expand Up @@ -5,7 +5,7 @@

Gem::Specification.new do |s|
s.name = %q{solve360}
s.version = "0.0.9"
s.version = "0.0.10"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Stephen Bartholomew"]
Expand Down
13 changes: 12 additions & 1 deletion spec/solve360/item_spec.rb
Expand Up @@ -227,7 +227,18 @@ class Car

describe "CGI Converting values" do
it "should convert html entities" do
@contact = Solve360::Contact.new(:fields => {"First Name" => "Steve & Cat"})
@contact = Solve360::Contact.new(:fields => {"First Name" => "Steve & Cat", "Last Name" => 29})
@contact.to_request.should match(/Steve \&amp\; Cat/)
@contact.to_request.should match(/29/)
end
end

describe "Debugging" do
before do
Solve360.debug
end

it "should enable debugging on all requests" do
Solve360::Contact.default_options[:debug_output].should_not be_nil
end
end

0 comments on commit 0c3f883

Please sign in to comment.