@@ -46,6 +46,79 @@ def test_array_with_one_element
46
46
assert_equal h , qbxml . from_qbxml ( "<?qbxml version=\" 7.0\" ?>\n <QBXML>\n <QBXMLMsgsRs>\n <CustomerQueryRs>\n <CustomerRet><ListID>abc</ListID></CustomerRet>\n </CustomerQueryRs>\n </QBXMLMsgsRs>\n </QBXML>\n " )
47
47
end
48
48
49
+ def test_float_percentage
50
+ qbxml = Qbxml . new
51
+ h = {
52
+ "qbxml" => {
53
+ "xml_attributes" => { } ,
54
+ "qbxml_msgs_rs" => {
55
+ "xml_attributes" => { } ,
56
+ "item_query_rs" => {
57
+ "xml_attributes" => {
58
+ "requestID" => "Retrieve items" ,
59
+ "statusCode" => "0" ,
60
+ "statusSeverity" => "Info" ,
61
+ "statusMessage" => "Status OK" ,
62
+ "iteratorRemainingCount" => "0" ,
63
+ "iteratorID" => "{10c05cbd-b25b-4a85-8aa0-8bce89e6e900}"
64
+ } ,
65
+ "item_service_ret" => {
66
+ "xml_attributes" => { } ,
67
+ "list_id" => "80000005-1468535148" ,
68
+ "time_created" => "2016-07-14T15:25:48-08:00" ,
69
+ "time_modified" => "2016-07-14T15:25:48-08:00" ,
70
+ "edit_sequence" => "1468535148" ,
71
+ "name" => "let's get intuit" ,
72
+ "full_name" => "let's get intuit" ,
73
+ "is_active" => true ,
74
+ "sublevel" => 0 ,
75
+ "sales_or_purchase" => {
76
+ "xml_attributes" => { } ,
77
+ "price_percent" => 18.0 ,
78
+ "account_ref" => {
79
+ "xml_attributes" => { } ,
80
+ "list_id" => "80000015-1457547358" ,
81
+ "full_name" => "Repairs and Maintenance"
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
49
89
50
- end
90
+ xml = <<-XML
91
+ <QBXML>
92
+ <QBXMLMsgsRs>
93
+ <ItemQueryRs requestID="Retrieve items"
94
+ statusCode="0"
95
+ statusSeverity="Info"
96
+ statusMessage="Status OK"
97
+ iteratorRemainingCount="0"
98
+ iteratorID="{10c05cbd-b25b-4a85-8aa0-8bce89e6e900}">
99
+ <ItemServiceRet>
100
+ <ListID>80000005-1468535148</ListID>
101
+ <TimeCreated>2016-07-14T15:25:48-08:00</TimeCreated>
102
+ <TimeModified>2016-07-14T15:25:48-08:00</TimeModified>
103
+ <EditSequence>1468535148</EditSequence>
104
+ <Name>let's get intuit</Name>
105
+ <FullName>let's get intuit</FullName>
106
+ <IsActive>true</IsActive>
107
+ <Sublevel>0</Sublevel>
108
+ <SalesOrPurchase>
109
+ <PricePercent>18.0%</PricePercent>
110
+ <AccountRef>
111
+ <ListID>80000015-1457547358</ListID>
112
+ <FullName>Repairs and Maintenance</FullName>
113
+ </AccountRef>
114
+ </SalesOrPurchase>
115
+ </ItemServiceRet>
116
+ </ItemQueryRs>
117
+ </QBXMLMsgsRs>
118
+ </QBXML>
119
+ XML
51
120
121
+ assert_equal h , qbxml . from_qbxml ( xml )
122
+ end
123
+
124
+ end
0 commit comments