Sha256: 44ac815d52eab1b7378aec2da0e4a65692c730d3d656b572cb03ef7820908a63

Contents?: true

Size: 770 Bytes

Versions: 48

Compression:

Stored size: 770 Bytes

Contents

require 'test_helper'

class UsageChargeTest < Test::Unit::TestCase

  def test_create_usage_charges
    fake "recurring_application_charges/654381177/usage_charges", method: :post, body: load_fixture('usage_charge')

    usage_charge = ShopifyAPI::UsageCharge.new(description: '1000 emails', price: 1.0)
    usage_charge.prefix_options = {recurring_application_charge_id: 654381177}
    assert usage_charge.save
  end

  def test_get_usage_charges
    fake "recurring_application_charges/654381177/usage_charges/359376002", method: :get, status: 201, body: load_fixture('usage_charge')

    usage_charge = ShopifyAPI::UsageCharge.find(359376002, params: {recurring_application_charge_id: 654381177})

    assert_equal "1000 emails", usage_charge.description
  end

end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
shopify_api-9.2.0 test/usage_charge_test.rb
shopify_api-9.1.0 test/usage_charge_test.rb
shopify_api-9.0.4 test/usage_charge_test.rb
shopify_api-9.0.3 test/usage_charge_test.rb
shopify_api-9.0.2 test/usage_charge_test.rb
shopify_api-9.0.1 test/usage_charge_test.rb
shopify_api-9.0.0 test/usage_charge_test.rb
shopify_api-8.1.0 test/usage_charge_test.rb
shopify_api-8.0.0 test/usage_charge_test.rb
shopify_api-7.1.0 test/usage_charge_test.rb
shopify_api-7.0.2 test/usage_charge_test.rb
shopify_api-7.0.1 test/usage_charge_test.rb
shopify_api-7.0.0 test/usage_charge_test.rb
shopify_api-6.0.0 test/usage_charge_test.rb
shopify_api-5.2.4 test/usage_charge_test.rb
shopify_api-5.2.3 test/usage_charge_test.rb
shopify_api-5.2.2 test/usage_charge_test.rb
shopify_api-5.2.1 test/usage_charge_test.rb
shopify_api-5.2.0 test/usage_charge_test.rb
shopify_api-5.1.0 test/usage_charge_test.rb