amazon_seller_central 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ gem "mechanize", ">= 1.0.0"
9
9
  # Include everything needed to run rake, tests, features, etc.
10
10
  group :development do
11
11
  gem "rspec", "~> 2.3.0"
12
- gem "bundler", "~> 1.0.0"
12
+ gem "bundler"
13
13
  gem "jeweler", "~> 1.6.3"
14
14
  gem "rcov", ">= 0"
15
15
  gem 'yard'
data/Gemfile.lock CHANGED
@@ -53,7 +53,7 @@ PLATFORMS
53
53
  ruby
54
54
 
55
55
  DEPENDENCIES
56
- bundler (~> 1.0.0)
56
+ bundler
57
57
  faker
58
58
  fakeweb
59
59
  ffi
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.7
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.7"
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-08-08"
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>, ["~> 1.0.0"])
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>, ["~> 1.0.0"])
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>, ["~> 1.0.0"])
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 ||= @page.search(".//div[@id='nextPage']").any?
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
@@ -2,8 +2,6 @@ module AmazonSellerCentral
2
2
  class PaymentsPage < Page
3
3
  attr_accessor :page
4
4
 
5
-
6
-
7
5
  def has_next?
8
6
  @has_next ||= @page.search('a').map(&:text).grep(/Next/).any?
9
7
  end
@@ -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 == "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")
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 == 3599
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[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
- listings[6].quantity.should == 1
44
- listings[6].condition.should == "New"
45
- listings[6].price_cents.should == 3399
46
- listings[6].status.should == "Active"
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[6]
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[6]
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[4]
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("PR24386-11")
14
- listing.sku.should == "PR24386-11"
15
- listing.asin.should == "B000MFORRA"
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("B002QEBM96")
19
+ listings = @listing_set.find("B003WFLGLM")
20
20
  listings.should be_kind_of(Enumerable)
21
- listings.first.sku.should == "PR23923-11"
22
- listings.first.asin.should == "B002QEBM96"
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