Sha256: 28883e5ce548a302f05033e6d21657d6e68de1c2a7d3ee52921e885a03c9e374

Contents?: true

Size: 697 Bytes

Versions: 5

Compression:

Stored size: 697 Bytes

Contents

require 'test_helper'

module Workarea
  module MailChimp
    class ProductTest < Workarea::TestCase
      def test_to_h
        product = create_product(id: "32F5411045")
        hsh = Product.new(product).to_h

        assert_equal(product.id, hsh[:id])
        assert_equal(product.name, hsh[:title])
        assert_equal(1, hsh[:variants].size)
        assert_equal(expected_variant_hash, hsh[:variants].first)
      end

      private
        def expected_variant_hash
          {
            id: "SKU",
            title: "SKU",
            sku: "SKU",
            price: "5.0",
            inventory_quantity: 99999,
            visibility: "true"
          }
        end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
workarea-mail_chimp-3.1.0 test/services/workarea/mail_chimp/product_test.rb
workarea-mail_chimp-3.0.5 test/services/workarea/mail_chimp/product_test.rb
workarea-mail_chimp-3.0.4 test/services/workarea/mail_chimp/product_test.rb
workarea-mail_chimp-3.0.3 test/services/workarea/mail_chimp/product_test.rb
workarea-mail_chimp-3.0.2 test/services/workarea/mail_chimp/product_test.rb