recurring_application_charge_test.rb 670 B

123456789101112131415161718192021
  1. require 'test_helper'
  2. class RecurringApplicationChargeTest < Test::Unit::TestCase
  3. context "#all" do
  4. should "get all charges" do
  5. fake "recurring_application_charges"
  6. charges = ShopifyAPI::RecurringApplicationCharge.all
  7. assert_equal "Super Duper Plan", charges.first.name
  8. end
  9. end
  10. should "not fail when there are no charges" do
  11. fake "recurring_application_charges", body: {recurring_application_charges: []}.to_json
  12. assert_equal 0, ShopifyAPI::RecurringApplicationCharge.all.count
  13. assert_equal nil, ShopifyAPI::RecurringApplicationCharge.current
  14. assert_equal [], ShopifyAPI::RecurringApplicationCharge.pending
  15. end
  16. end