Sha256: b14bc5c2faf21869d4cca604c67691b97efe8574781b40d9230e6d585dfef1a0
Contents?: true
Size: 1020 Bytes
Versions: 26
Compression:
Stored size: 1020 Bytes
Contents
require 'test_helper' class DiscoApp::HasMetafieldsTest < ActiveSupport::TestCase include DiscoApp::Test::ShopifyAPI def setup @product = products(:ipod) @shop = @product.shop end def teardown @product = nil @shop = nil end test 'can write metafields with a single namespace' do stub_api_request(:put, "#{@shop.admin_url}/products/#{@product.id}.json", 'widget_store/products/write_metafields_single_namespace') assert @shop.with_api_context { @product.write_metafields( namespace1: { key1: 'value1', key2: 2 } ) } end test 'can write metafields with multiple namespaces' do stub_api_request(:put, "#{@shop.admin_url}/products/#{@product.id}.json", 'widget_store/products/write_metafields_multiple_namespaces') assert @shop.with_api_context { @product.write_metafields( namespace1: { n1key1: 'value1', n1key2: 2 }, namespace2: { n2key3: 'value3', n2key4: 2 }, ) } end end
Version data entries
26 entries across 26 versions & 1 rubygems