瀏覽代碼

Test for RecurringApplicationCharge 404 response

test case for https://github.com/Shopify/shopify_api/pull/147
justinstern 10 年之前
父節點
當前提交
8fd48c1b69
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      test/recurring_application_charge_test.rb

+ 8 - 0
test/recurring_application_charge_test.rb

@@ -104,4 +104,12 @@ class RecurringApplicationChargeTest < Test::Unit::TestCase
     assert_equal [], ShopifyAPI::RecurringApplicationCharge.pending
   end
 
+  def test_recurring_application_charge_not_found_error
+    fake "recurring_application_charges", :body => '{"errors":"Not Found"}', :status => 404
+
+    assert_equal nil, ShopifyAPI::RecurringApplicationCharge.all
+    assert_equal nil, ShopifyAPI::RecurringApplicationCharge.current
+    assert_equal [],  ShopifyAPI::RecurringApplicationCharge.pending
+  end
+
 end