require 'spec_helper' module Peddler module Reports describe UnshippedOrdersReport do let(:transport) do transport = Peddler::Transport.new transport.modernize_request transport.stub!(:execute_request).and_return('\n2597613290_GET_FLAT_FILE_ACTIONABLE_ORDER_DATA_2009-08-05T19:54:31+00:002009-08-12T19:54:31+00:00false_SUBMITTED_2009-08-12T19:54:31+00:00') transport end let(:report) { Peddler::Reports::UnshippedOrdersReport.new(transport) } it 'generates a request' do report.id.should == '2597613290' report.status.should == '_SUBMITTED_' end it 'updates status' do transport.stub!(:execute_request).and_return('\n2893967048_GET_FLAT_FILE_ACTIONABLE_ORDER_DATA_2010-01-04T00:00:00+00:002010-01-12T00:00:00+00:00false_SUBMITTED_2010-01-11T06:02:40+00:00') report.status!.should == '_SUBMITTED_' end end end end