quickbooks_web_connector 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,7 +17,7 @@ describe QuickbooksWebConnector::Job do
17
17
  allow(SomeBuilder).to receive(:perform).and_raise(Exception)
18
18
  job = described_class.new 'request_builder_class' => 'SomeBuilder'
19
19
 
20
- expect { job.request_xml }.to_not raise_exception
20
+ expect(job.request_xml).to eq(:failed)
21
21
 
22
22
  expect(QuickbooksWebConnector::Failure.count).to be(1)
23
23
  end
@@ -106,6 +106,15 @@ describe QuickbooksWebConnector::SoapWrapper::QBWebConnectorSvcSoap do
106
106
  expect(response).to be_a(QuickbooksWebConnector::SoapWrapper::SendRequestXMLResponse)
107
107
  expect(response.sendRequestXMLResult).to eq('<some><xml></xml></some>')
108
108
  end
109
+
110
+ it 'continues onto the next job when the builder errors' do
111
+ allow(SomeBuilder).to receive(:perform).with(1).and_return('<some><xml></xml></some>')
112
+ QuickbooksWebConnector.enqueue SomeBuilderThatErrors, SomeHandler, 1
113
+ QuickbooksWebConnector.enqueue SomeBuilder, SomeHandler, 1
114
+
115
+ expect(response).to be_a(QuickbooksWebConnector::SoapWrapper::SendRequestXMLResponse)
116
+ expect(response.sendRequestXMLResult).to eq('<some><xml></xml></some>')
117
+ end
109
118
  end
110
119
 
111
120
  describe 'receiveResponseXML' do
data/spec/spec_helper.rb CHANGED
@@ -50,6 +50,12 @@ class SomeBuilder
50
50
  end
51
51
  end
52
52
 
53
+ class SomeBuilderThatErrors
54
+ def self.perform(*args)
55
+ raise 'FAILURE'
56
+ end
57
+ end
58
+
53
59
  class SomeHandler
54
60
  def self.perform(response_xml, *args)
55
61
  end
Binary file