Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Commit

Permalink
fix bug that striped spaces in query result
Browse files Browse the repository at this point in the history
  • Loading branch information
Leif Gensert committed Apr 30, 2013
1 parent acddd8a commit d045db1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/salesforce_bulk/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def process_xml_response res
end

def process_csv_response res
CSV.parse(res.gsub(/[ \t+]/,''), headers: true).map{|r| r.to_hash}
CSV.parse(res.gsub(/\n\s+/, "\n"), headers: true).map{|r| r.to_hash}
end

def process_soap_response res
Expand Down
5 changes: 2 additions & 3 deletions spec/lib/salesforce_bulk/http_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
let(:batch_result_data_with_spaces_success) do
%Q{"Id","Name"
"003K000057GH39aIAD","Master of Disaster"
"003K001200KO82cIAD","King of the Hill"}
"003K001200KO82cIAD","King of the Hill"}
end

it 'should return array of arrays for data' do
Expand All @@ -283,13 +283,12 @@
end

it 'should return correct array with spaces' do
pending 'needs to be fixed'
SalesforceBulk::Http.should_receive(:process_http_request).
and_return(batch_result_data_with_spaces_success)
result = SalesforceBulk::Http.query_batch_result_data('a','b','c','d','e','f')
expect(result).to eq([
{'Id' => '003K000057GH39aIAD', 'Name' => 'Master of Disaster'},
{'Id' => '003K001200KO82cIAD', 'Name' => 'King of the Hill'}])
{'Id' => '003K001200KO82cIAD', 'Name' => 'King of the Hill'}])
end
end
end

0 comments on commit d045db1

Please sign in to comment.