| 
														
															@@ -3,12 +3,8 @@ require 'test_helper' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 class VariantTest < Test::Unit::TestCase 
														 | 
														
														 | 
														
															 class VariantTest < Test::Unit::TestCase 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def setup 
														 | 
														
														 | 
														
															   def setup 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     super 
														 | 
														
														 | 
														
															     super 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    @version_unstable = ShopifyAPI::ApiVersion.find_version('unstable') 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    @version_2019_07 = ShopifyAPI::ApiVersion.find_version('2019-07') 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    @version_2019_10 = ShopifyAPI::ApiVersion.find_version('2019-10') 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    @version_2020_01 = ShopifyAPI::ApiVersion.find_version('2020-01') 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    fake "products/632910392/variants/808950810", method: :get, body: load_fixture('variant') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @variant = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_get_variants 
														 | 
														
														 | 
														
															   def test_get_variants 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -19,181 +15,91 @@ class VariantTest < Test::Unit::TestCase 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_get_variant_namespaced 
														 | 
														
														 | 
														
															   def test_get_variant_namespaced 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake "products/632910392/variants/808950810", :method => :get, :body => load_fixture('variant') 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    v = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    assert_equal 632910392, v.product_id 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    assert_equal 632910392, @variant.product_id 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_get_variant 
														 | 
														
														 | 
														
															   def test_get_variant 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake "variants/808950810", :method => :get, :body => load_fixture('variant') 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    v = ShopifyAPI::Variant.find(808950810) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    assert_equal 632910392, v.product_id 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    assert_equal 632910392, @variant.product_id 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_product_id_should_be_accessible_if_via_product_endpoint 
														 | 
														
														 | 
														
															   def test_product_id_should_be_accessible_if_via_product_endpoint 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake "products/632910392/variants/808950810", :method => :get, :body => load_fixture('variant') 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    v = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    assert_equal 632910392, v.product_id 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    assert_equal 632910392, @variant.product_id 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_product_id_should_be_accessible_if_via_variant_endpoint 
														 | 
														
														 | 
														
															   def test_product_id_should_be_accessible_if_via_variant_endpoint 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     fake "variants/808950810", :method => :get, :body => load_fixture('variant') 
														 | 
														
														 | 
														
															     fake "variants/808950810", :method => :get, :body => load_fixture('variant') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    v = ShopifyAPI::Variant.find(808950810) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    assert_equal 632910392, v.product_id 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    assert_equal 632910392, @variant.product_id 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_delete_variant 
														 | 
														
														 | 
														
															   def test_delete_variant 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake "products/632910392/variants/808950810", :method => :get, :body => load_fixture('variant') 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     fake "products/632910392/variants/808950810", :method => :delete, :body => 'destroyed' 
														 | 
														
														 | 
														
															     fake "products/632910392/variants/808950810", :method => :delete, :body => 'destroyed' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    v = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    assert v.destroy 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    assert @variant.destroy 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_deprecated_inventory_fields_are_included_in_2019_07 
														 | 
														
														 | 
														
															   def test_deprecated_inventory_fields_are_included_in_2019_07 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-07' 
														 | 
														
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-07' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      "products/632910392/variants/808950810", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      method: :get, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      body: load_fixture('variant'), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      api_version: @version_2019_07 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    ) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    assert variant.as_json.include?('inventory_quantity') 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    assert @variant.as_json.include?('inventory_quantity') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_deprecated_inventory_fields_are_removed_in_2020_01 
														 | 
														
														 | 
														
															   def test_deprecated_inventory_fields_are_removed_in_2020_01 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     ShopifyAPI::Base.api_version = '2020-01' 
														 | 
														
														 | 
														
															     ShopifyAPI::Base.api_version = '2020-01' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      "products/632910392/variants/808950810", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      method: :get, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      body: load_fixture('variant'), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      api_version: @version_2020_01 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    ) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    refute variant.as_json.include?('inventory_quantity') 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    refute @variant.as_json.include?('inventory_quantity') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_setting_variant_inventory_quantity_adjustment_passes_in_api_before_2019_10 
														 | 
														
														 | 
														
															   def test_setting_variant_inventory_quantity_adjustment_passes_in_api_before_2019_10 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-07' 
														 | 
														
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-07' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      "products/632910392/variants/808950810", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      method: :get, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      body: load_fixture('variant'), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      api_version: @version_2019_07 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    ) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant.inventory_quantity_adjustment = 8 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @variant.inventory_quantity_adjustment = 8 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_setting_variant_inventory_quantity_adjustment_fails_in_2019_10_api 
														 | 
														
														 | 
														
															   def test_setting_variant_inventory_quantity_adjustment_fails_in_2019_10_api 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-10' 
														 | 
														
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-10' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      "products/632910392/variants/808950810", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      method: :get, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      body: load_fixture('variant'), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      api_version: @version_2019_10 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    ) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     assert_raises(ShopifyAPI::ValidationException) do 
														 | 
														
														 | 
														
															     assert_raises(ShopifyAPI::ValidationException) do 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      variant.inventory_quantity_adjustment = 8 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      @variant.inventory_quantity_adjustment = 8 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     end 
														 | 
														
														 | 
														
															     end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_setting_variant_inventory_quantity_adjustment_fails_in_the_unstable_api 
														 | 
														
														 | 
														
															   def test_setting_variant_inventory_quantity_adjustment_fails_in_the_unstable_api 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     ShopifyAPI::Base.api_version = :unstable 
														 | 
														
														 | 
														
															     ShopifyAPI::Base.api_version = :unstable 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      "products/632910392/variants/808950810", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      method: :get, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      body: load_fixture('variant'), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      api_version: @version_unstable 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    ) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     assert_raises(ShopifyAPI::ValidationException) do 
														 | 
														
														 | 
														
															     assert_raises(ShopifyAPI::ValidationException) do 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      variant.inventory_quantity_adjustment = 8 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      @variant.inventory_quantity_adjustment = 8 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     end 
														 | 
														
														 | 
														
															     end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_setting_variant_inventory_quantity_passes_in_api_before_2019_10 
														 | 
														
														 | 
														
															   def test_setting_variant_inventory_quantity_passes_in_api_before_2019_10 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-07' 
														 | 
														
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-07' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      "products/632910392/variants/808950810", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      method: :get, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      body: load_fixture('variant'), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      api_version: @version_2019_07 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    ) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant.inventory_quantity = 8 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @variant.inventory_quantity = 8 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_setting_variant_inventory_quantity_fails_in_2019_10_api 
														 | 
														
														 | 
														
															   def test_setting_variant_inventory_quantity_fails_in_2019_10_api 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-10' 
														 | 
														
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-10' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      "products/632910392/variants/808950810", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      method: :get, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      body: load_fixture('variant'), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      api_version: @version_2019_10 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    ) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     assert_raises(ShopifyAPI::ValidationException) do 
														 | 
														
														 | 
														
															     assert_raises(ShopifyAPI::ValidationException) do 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      variant.inventory_quantity = 8 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      @variant.inventory_quantity = 8 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     end 
														 | 
														
														 | 
														
															     end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_setting_variant_inventory_quantity_fails_in_the_unstable_api 
														 | 
														
														 | 
														
															   def test_setting_variant_inventory_quantity_fails_in_the_unstable_api 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     ShopifyAPI::Base.api_version = :unstable 
														 | 
														
														 | 
														
															     ShopifyAPI::Base.api_version = :unstable 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      "products/632910392/variants/808950810", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      method: :get, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      body: load_fixture('variant'), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      api_version: @version_unstable 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    ) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     assert_raises(ShopifyAPI::ValidationException) do 
														 | 
														
														 | 
														
															     assert_raises(ShopifyAPI::ValidationException) do 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      variant.inventory_quantity = 8 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      @variant.inventory_quantity = 8 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     end 
														 | 
														
														 | 
														
															     end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_setting_variant_old_inventory_quantity_passes_in_api_before_2019_10 
														 | 
														
														 | 
														
															   def test_setting_variant_old_inventory_quantity_passes_in_api_before_2019_10 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-07' 
														 | 
														
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-07' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      "products/632910392/variants/808950810", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      method: :get, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      body: load_fixture('variant'), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      api_version: @version_2019_07 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    ) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant.old_inventory_quantity = 8 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @variant.old_inventory_quantity = 8 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_setting_variant_old_inventory_quantity_fails_in_2019_10_api 
														 | 
														
														 | 
														
															   def test_setting_variant_old_inventory_quantity_fails_in_2019_10_api 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-10' 
														 | 
														
														 | 
														
															     ShopifyAPI::Base.api_version = '2019-10' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      "products/632910392/variants/808950810", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      method: :get, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      body: load_fixture('variant'), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      api_version: @version_2019_10 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    ) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     assert_raises(ShopifyAPI::ValidationException) do 
														 | 
														
														 | 
														
															     assert_raises(ShopifyAPI::ValidationException) do 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      variant.old_inventory_quantity = 8 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      @variant.old_inventory_quantity = 8 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     end 
														 | 
														
														 | 
														
															     end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   def test_setting_variant_old_inventory_quantity_fails_in_the_unstable_api 
														 | 
														
														 | 
														
															   def test_setting_variant_old_inventory_quantity_fails_in_the_unstable_api 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     ShopifyAPI::Base.api_version = :unstable 
														 | 
														
														 | 
														
															     ShopifyAPI::Base.api_version = :unstable 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fake( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      "products/632910392/variants/808950810", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      method: :get, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      body: load_fixture('variant'), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      api_version: @version_unstable 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    ) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    variant = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392}) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     assert_raises(ShopifyAPI::ValidationException) do 
														 | 
														
														 | 
														
															     assert_raises(ShopifyAPI::ValidationException) do 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      variant.old_inventory_quantity = 8 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      @variant.old_inventory_quantity = 8 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     end 
														 | 
														
														 | 
														
															     end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   end 
														 | 
														
														 | 
														
															   end 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 end 
														 | 
														
														 | 
														
															 end 
														 |