amazon_seller_central 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/amazon_seller_central.gemspec +5 -5
- data/lib/amazon_seller_central/inventory_page.rb +4 -1
- data/lib/amazon_seller_central/payments_page.rb +0 -2
- data/spec/lib/inventory_page_spec.rb +17 -17
- data/spec/lib/listing_set_spec.rb +6 -6
- data/spec/support/sample_pages/Payments Page.html +1408 -184
- data/spec/support/sample_pages/listings_last_page.html +704 -2444
- data/spec/support/sample_pages/listings_page_1.html +7825 -7443
- data/spec/support/sample_pages/listings_page_2.html +7589 -7345
- data/spec/support/sample_pages/update_inventory_result_from_page_1.html +7824 -7442
- metadata +33 -33
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.8
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "amazon_seller_central"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["optoro"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-09-07"
|
13
13
|
s.description = "This gem is intended to wrap Amazon's SellerCentral pages with a Ruby API. Currently this gem supports accessing buyer feedback only."
|
14
14
|
s.email = "dev@optoro.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -88,7 +88,7 @@ Gem::Specification.new do |s|
|
|
88
88
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
89
89
|
s.add_runtime_dependency(%q<mechanize>, [">= 1.0.0"])
|
90
90
|
s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
|
91
|
-
s.add_development_dependency(%q<bundler>, ["
|
91
|
+
s.add_development_dependency(%q<bundler>, [">= 0"])
|
92
92
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.3"])
|
93
93
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
94
94
|
s.add_development_dependency(%q<yard>, [">= 0"])
|
@@ -103,7 +103,7 @@ Gem::Specification.new do |s|
|
|
103
103
|
else
|
104
104
|
s.add_dependency(%q<mechanize>, [">= 1.0.0"])
|
105
105
|
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
106
|
-
s.add_dependency(%q<bundler>, ["
|
106
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
107
107
|
s.add_dependency(%q<jeweler>, ["~> 1.6.3"])
|
108
108
|
s.add_dependency(%q<rcov>, [">= 0"])
|
109
109
|
s.add_dependency(%q<yard>, [">= 0"])
|
@@ -119,7 +119,7 @@ Gem::Specification.new do |s|
|
|
119
119
|
else
|
120
120
|
s.add_dependency(%q<mechanize>, [">= 1.0.0"])
|
121
121
|
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
122
|
-
s.add_dependency(%q<bundler>, ["
|
122
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
123
123
|
s.add_dependency(%q<jeweler>, ["~> 1.6.3"])
|
124
124
|
s.add_dependency(%q<rcov>, [">= 0"])
|
125
125
|
s.add_dependency(%q<yard>, [">= 0"])
|
@@ -8,7 +8,10 @@ module AmazonSellerCentral
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def has_next?
|
11
|
-
@has_next ||=
|
11
|
+
@has_next ||= begin
|
12
|
+
v = @page.search(".//div[@id='ila-page-next']")
|
13
|
+
v.first && v.first.attributes["class"].value !~ /ila-page-nextDisabled/
|
14
|
+
end
|
12
15
|
end
|
13
16
|
|
14
17
|
def next_page
|
@@ -25,25 +25,25 @@ describe "InventoryPage" do
|
|
25
25
|
listings = @first_page.listings
|
26
26
|
listings.size.should == 250
|
27
27
|
|
28
|
-
listings[3].sku.should == "
|
29
|
-
listings[3].asin.should == "
|
30
|
-
listings[3].product_name.should == "
|
31
|
-
listings[3].created_at.should == Time.parse("2012-
|
28
|
+
listings[3].sku.should == "PR80470-1"
|
29
|
+
listings[3].asin.should == "B004TIR1E2"
|
30
|
+
listings[3].product_name.should == "Motorola DS9208 Desktop Bar Code Reader (DS9208-SR00004NNWW) -"
|
31
|
+
listings[3].created_at.should == Time.parse("2012-09-06 13:48:12")
|
32
32
|
listings[3].quantity.should == 1
|
33
|
-
listings[3].condition.should == "New"
|
34
|
-
listings[3].price_cents.should ==
|
33
|
+
listings[3].condition.should == "Used - Like New"
|
34
|
+
listings[3].price_cents.should == 20239
|
35
35
|
listings[3].low_price.should == nil
|
36
36
|
listings[3].low_price_cents.should == nil
|
37
37
|
listings[3].status.should == "Active"
|
38
38
|
|
39
|
-
listings[
|
40
|
-
listings[
|
41
|
-
listings[
|
42
|
-
listings[
|
43
|
-
listings[
|
44
|
-
listings[
|
45
|
-
listings[
|
46
|
-
listings[
|
39
|
+
listings[0].sku.should == "PR90962-11"
|
40
|
+
listings[0].asin.should == "B0012FG8BC"
|
41
|
+
listings[0].product_name.should == "COGNITIVE 03-02-1519 2.3 X 1 DIR THERM PAPER LABELS GAP CUT,1685 LABELS/ROLL"
|
42
|
+
listings[0].created_at.should == Time.parse("2012-09-06 14:32:56")
|
43
|
+
listings[0].quantity.should == 1
|
44
|
+
listings[0].condition.should == "New"
|
45
|
+
listings[0].price_cents.should == 8499
|
46
|
+
listings[0].status.should == "Active"
|
47
47
|
end
|
48
48
|
|
49
49
|
# it "loads listings appropriately for another sample page" do
|
@@ -65,7 +65,7 @@ describe "InventoryPage" do
|
|
65
65
|
|
66
66
|
it "accepts a set of Listing objects to apply updates to the page" do
|
67
67
|
listings = @first_page.listings
|
68
|
-
l = listings[
|
68
|
+
l = listings[0]
|
69
69
|
# l.quantity = 0
|
70
70
|
# l.price = 225.59
|
71
71
|
l.quantity = 2
|
@@ -78,7 +78,7 @@ describe "InventoryPage" do
|
|
78
78
|
(@first_page.instance_variable_get('@agent').last_page.parser.css('div#msg_saveSuccess')[0]['style'] !~ /display: none/).should be_true
|
79
79
|
|
80
80
|
FakeWeb.register_uri(:get, 'https://sellercentral.amazon.com/gp/ezdpc-gui/inventory-status/status.html/ref=ag_invmgr_mmap_home', :response => mock_pages[:update_inventory_result_from_page_1])
|
81
|
-
listing = AmazonSellerCentral::Inventory.load_first_page.listings[
|
81
|
+
listing = AmazonSellerCentral::Inventory.load_first_page.listings[0]
|
82
82
|
listing.sku.should == l.sku
|
83
83
|
listing.quantity.should == l.quantity
|
84
84
|
listing.price.should == l.price
|
@@ -86,7 +86,7 @@ describe "InventoryPage" do
|
|
86
86
|
|
87
87
|
it "raises an unsupported modification error when trying to set the price on an incomplete listing" do
|
88
88
|
listings = @first_page.listings
|
89
|
-
l = listings[
|
89
|
+
l = listings[2]
|
90
90
|
l.price = 24.26
|
91
91
|
lambda {
|
92
92
|
@first_page.apply_listings([l])
|
@@ -10,16 +10,16 @@ describe "ListingSet" do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
it "allows find by sku" do
|
13
|
-
listing = @listing_set.find("
|
14
|
-
listing.sku.should == "
|
15
|
-
listing.asin.should == "
|
13
|
+
listing = @listing_set.find("PR68921-11")
|
14
|
+
listing.sku.should == "PR68921-11"
|
15
|
+
listing.asin.should == "B003WFLGLM"
|
16
16
|
end
|
17
17
|
|
18
18
|
it "allows find by asin" do
|
19
|
-
listings = @listing_set.find("
|
19
|
+
listings = @listing_set.find("B003WFLGLM")
|
20
20
|
listings.should be_kind_of(Enumerable)
|
21
|
-
listings.first.sku.should == "
|
22
|
-
listings.first.asin.should == "
|
21
|
+
listings.first.sku.should == "PR68921-11"
|
22
|
+
listings.first.asin.should == "B003WFLGLM"
|
23
23
|
end
|
24
24
|
|
25
25
|
# it "allows where by quantity" do
|