Pārlūkot izejas kodu

Refs #198: Tweak statuses for ApplicationCharge convenience method.

Gavin Ballard 9 gadi atpakaļ
vecāks
revīzija
2b20a1ee27

+ 1 - 1
lib/shopify_api/resources/application_charge.rb

@@ -3,7 +3,7 @@ module ShopifyAPI
     undef_method :test
 
     class << self
-      [:pending, :cancelled, :accepted, :declined].each do |status|
+      [:pending, :expired, :accepted, :declined].each do |status|
         define_method(status) { (all || []).select { |c| c.status == status.to_s } }
       end
     end

+ 4 - 4
test/application_charge_test.rb

@@ -40,13 +40,13 @@ class ApplicationChargeTest < Test::Unit::TestCase
     assert_equal "Screen Replacement", pending_charges.first.name
   end
 
-  def test_list_cancelled_application_charges
+  def test_list_expired_application_charges
     fake "application_charges", :method => :get, :status => 201, :body => load_fixture('application_charges')
 
-    cancelled_charges = ShopifyAPI::ApplicationCharge.cancelled
+    expired_charges = ShopifyAPI::ApplicationCharge.expired
 
-    assert_equal 1, cancelled_charges.size
-    assert_equal "iPod Cleaning", cancelled_charges.first.name
+    assert_equal 1, expired_charges.size
+    assert_equal "iPod Cleaning", expired_charges.first.name
   end
 
   def test_list_accepted_application_charges

+ 1 - 1
test/fixtures/application_charges.json

@@ -34,7 +34,7 @@
       "name": "iPod Cleaning",
       "price": "5.00",
       "return_url": "http:\/\/google.com",
-      "status": "cancelled",
+      "status": "expired",
       "test": null,
       "updated_at": "2015-07-10T15:03:51+10:00",
       "charge_type": null,