amazon_seller_central 0.2.6 → 0.2.7
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/VERSION +1 -1
- data/amazon_seller_central.gemspec +2 -2
- data/lib/amazon_seller_central/inventory_page.rb +1 -1
- data/spec/lib/inventory_page_spec.rb +13 -13
- data/spec/support/page_body_regexen.rb +3 -3
- data/spec/support/sample_pages/listings_last_page.html +2539 -5065
- data/spec/support/sample_pages/listings_page_1.html +8906 -22162
- data/spec/support/sample_pages/listings_page_2.html +9606 -8567
- data/spec/support/sample_pages/update_inventory_result_from_page_1.html +8915 -22182
- metadata +31 -31
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.7
|
@@ -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.7"
|
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-08-08"
|
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 = [
|
@@ -30,7 +30,7 @@ module AmazonSellerCentral
|
|
30
30
|
@listings ||= begin
|
31
31
|
set = ListingSet.new
|
32
32
|
# being more specific here breaks on some pages
|
33
|
-
@page.parser.css('tr').select{|r| r['id'] =~ /^sku-/ && r.css('td').size ==
|
33
|
+
@page.parser.css('tr').select{|r| r['id'] =~ /^sku-/ && r.css('td').size == 14 }.each do |row|
|
34
34
|
set << listing_row_to_object(row)
|
35
35
|
end
|
36
36
|
set
|
@@ -23,26 +23,26 @@ describe "InventoryPage" do
|
|
23
23
|
|
24
24
|
it "transforms itself into a set of Listing objects" do
|
25
25
|
listings = @first_page.listings
|
26
|
-
listings.size.should ==
|
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-
|
32
|
-
listings[3].quantity.should ==
|
28
|
+
listings[3].sku.should == "PR87099-11"
|
29
|
+
listings[3].asin.should == "B002WPG0NM"
|
30
|
+
listings[3].product_name.should == "Cuisinart 422-30H Contour Stainless 12-Inch Open Skillet with Helper Handle"
|
31
|
+
listings[3].created_at.should == Time.parse("2012-08-08 12:32:55")
|
32
|
+
listings[3].quantity.should == 1
|
33
33
|
listings[3].condition.should == "New"
|
34
|
-
listings[3].price_cents.should ==
|
34
|
+
listings[3].price_cents.should == 3599
|
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[6].sku.should == "
|
40
|
-
listings[6].asin.should == "
|
41
|
-
listings[6].product_name.should == "
|
42
|
-
listings[6].created_at.should == Time.parse("2012-
|
39
|
+
listings[6].sku.should == "PR86164-11"
|
40
|
+
listings[6].asin.should == "B000JZD71K"
|
41
|
+
listings[6].product_name.should == "Dorman 520-223 Control Arm"
|
42
|
+
listings[6].created_at.should == Time.parse("2012-08-08 12:27:55")
|
43
43
|
listings[6].quantity.should == 1
|
44
44
|
listings[6].condition.should == "New"
|
45
|
-
listings[6].price_cents.should ==
|
45
|
+
listings[6].price_cents.should == 3399
|
46
46
|
listings[6].status.should == "Active"
|
47
47
|
end
|
48
48
|
|
@@ -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[4]
|
90
90
|
l.price = 24.26
|
91
91
|
lambda {
|
92
92
|
@first_page.apply_listings([l])
|
@@ -1,6 +1,6 @@
|
|
1
|
-
INVENTORY_FIRST_PAGE_TEST_REGEX = /inv|
|
2
|
-
INVENTORY_SECOND_PAGE_TEST_REGEX = /inv|
|
3
|
-
INVENTORY_LAST_PAGE_TEST_REGEX = /inv|
|
1
|
+
INVENTORY_FIRST_PAGE_TEST_REGEX = /inv|PR69263-3|B0051OMY6I/
|
2
|
+
INVENTORY_SECOND_PAGE_TEST_REGEX = /inv|PR42715-3|B0007018ZE/
|
3
|
+
INVENTORY_LAST_PAGE_TEST_REGEX = /inv|PR52471-11|B000067RTE/
|
4
4
|
|
5
5
|
FEEDBACK_FIRST_PAGE_TEST_REGEX = /Wow! Amazing price, super fast shipping./
|
6
6
|
FEEDBACK_SECOND_PAGE_TEST_REGEX = /This printer was not in good shape as the seller described./
|