Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added SyncStatus

  • Loading branch information...
commit b87a4c7c92811b4ed6b44c26ba9be1386333bc9e 1 parent 5a47835
@eugenebolshakov eugenebolshakov authored
View
1  lib/intuit.rb
@@ -15,6 +15,7 @@ module Intuit
autoload :SalesTax, "intuit/sales_tax"
autoload :Vendor, "intuit/vendor"
autoload :SyncActivity, "intuit/sync_activity"
+ autoload :SyncStatus, "intuit/sync_status"
# Configuration
View
38 lib/intuit/sync_status.rb
@@ -0,0 +1,38 @@
+require "time"
+
+module Intuit
+ class SyncStatus < Base
+ element "NgId", :as => :object_id
+ element "NgObjectType", :as => :object_type
+ element "RequestId", :as => :request_id
+ element "StateCode", :as => :state_code
+ element "StateDesc", :as => :state
+ element "MessageCode", :as => :message_code
+ element "MessageDesc", :as => :message
+
+ class << self
+ def all(time_filters)
+ filters = {
+ :OfferingId => "ipp",
+ :StartCreatedTMS => time_filters[:start_time].utc.xmlschema,
+ :EndCreatedTMS => time_filters[:end_time].utc.xmlschema
+ }
+ super filters
+ end
+
+ # Intuit Query-specific stuff
+
+ def request_uri
+ "status"
+ end
+
+ def retrieve_request_name
+ "SyncStatusRequest"
+ end
+
+ def retrieve_response_name
+ "SyncStatusResponse"
+ end
+ end
+ end
+end
View
2  test/integration/sync_test.rb → test/integration/sync_activity_test.rb
@@ -4,7 +4,7 @@
module Intuit
module Integration
- class SyncTest < TestCase
+ class SyncActivityTest < TestCase
test "get sync activity" do
start_time = Time.parse("10 Jan 2012 00:00:00 UTC")
end_time = Time.parse("11 Jan 2012 23:59:59 UTC")
View
16 test/integration/sync_status_test.rb
@@ -0,0 +1,16 @@
+require "test_helper"
+require "nokogiri"
+require "time"
+
+module Intuit
+ module Integration
+ class SyncStatusTest < TestCase
+ test "get sync status" do
+ start_time = Time.parse("10 Jan 2012 00:00:00 UTC")
+ end_time = Time.parse("11 Jan 2012 23:59:59 UTC")
+ statuses = SyncStatus.all(:start_time => start_time, :end_time => end_time)
+ assert !statuses.empty?
+ end
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.