Sha256: 35e3e47addc1ece60ccec29734fa676444ad67cd71b776daa7418bb422056eda

Contents?: true

Size: 952 Bytes

Versions: 30

Compression:

Stored size: 952 Bytes

Contents

# frozen_string_literal: true
require 'test_helper'

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

    @expected_checkouts = JSON.parse(load_fixture('abandoned_checkouts'))['checkouts']
    @expected_checkout_id = JSON.parse(load_fixture('abandoned_checkout'))['checkout']['id']
  end

  test ":create creates a checkout" do
    fake 'checkouts', method: :post, status: 201, body: load_fixture('abandoned_checkout')

    checkout = ShopifyAPI::AbandonedCheckout.create

    assert_equal @expected_checkout_id, checkout.id
    assert_equal true, checkout.attributes.include?(:abandoned_checkout_url)
  end

  test "get all checkouts indexed by token" do
    fake 'checkouts', method: :get, status: 200, body: load_fixture('abandoned_checkouts')

    checkouts = ShopifyAPI::AbandonedCheckout.all

    assert_equal @expected_checkout_id, checkouts.first.id
    assert_equal @expected_checkouts.size, checkouts.size
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

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