Sha256: b3893a847899a0718a7231ed9bda62aaa05ffe7a0df5fe3c11bcdc8a7b5cdd30

Contents?: true

Size: 594 Bytes

Versions: 30

Compression:

Stored size: 594 Bytes

Contents

# frozen_string_literal: true
require 'test_helper'

class PaymentTest < Test::Unit::TestCase
  def setup
    super

    @checkout_id = JSON.parse(load_fixture('checkout'))['checkout']['token']
    @expected_payment = JSON.parse(load_fixture('payment'))['payment']
  end

  test ":create creates a new payment" do
    fake "checkouts/#{@checkout_id}/payments", method: :post, status: 201, body: load_fixture('payment')

    new_payment = ShopifyAPI::Payment.create(checkout_id: @checkout_id)

    assert_equal @expected_payment['unique_token'], new_payment.attributes['unique_token']
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
shopify_api-9.5.2 test/payment_test.rb
ruby_shopify_api-1.2.0 test/payment_test.rb
ruby_shopify_api-1.1.0 test/payment_test.rb
ruby_shopify_api-1.0.0 test/payment_test.rb
shopify_api-9.5.1 test/payment_test.rb
shopify_api-9.5 test/payment_test.rb
shopify_api-9.4.1 test/payment_test.rb
shopify_api-9.4.0 test/payment_test.rb
shopify_api-9.3.0 test/payment_test.rb
shopify_api-9.2.0 test/payment_test.rb
shopify_api-9.1.0 test/payment_test.rb
shopify_api-9.0.4 test/payment_test.rb
shopify_api-9.0.3 test/payment_test.rb
shopify_api-9.0.2 test/payment_test.rb
shopify_api-9.0.1 test/payment_test.rb
shopify_api-9.0.0 test/payment_test.rb
shopify_api-8.1.0 test/payment_test.rb
shopify_api-8.0.0 test/payment_test.rb
shopify_api-7.1.0 test/payment_test.rb
shopify_api-7.0.2 test/payment_test.rb