require 'spec_helper' describe Dineromail::StatusReport do it 'should load the status report from xml' do xml = ' 1889 01/28/2011 12:02:01 PM 1 67777 comprador@email.com San Martin 10 comentario Juan 4444444 DNI 222222222 60.2 50.3 TARJETA DE CREDITO VISA 1 Libro 1 6.90 2 ' status_report = Dineromail::StatusReport.new status_report.parse_response(xml) buyer = status_report.buyer item = status_report.items.first status_report.transaction_id.should == 1889 status_report.date.should == DateTime.ordinal(2011,28,12,2,1) status_report.status.should == Dineromail::StatusReport::PENDING_STATUS status_report.amount.should == 60.2 status_report.net_amount.should == 50.3 status_report.pay_method.should == 'TARJETA DE CREDITO' status_report.pay_medium.should == 'VISA' buyer.email.should == 'comprador@email.com' buyer.address.should == 'San Martin 10' buyer.comment.should == 'comentario' buyer.name.should == 'Juan' buyer.phone.should == '4444444' buyer.document_type.should == 'DNI' buyer.document_number.should == '222222222' item.description.should == 'Libro' item.currency.should == 1 item.count.should == 2 item.unit_price.should == 6.9 end end