Sfoglia il codice sorgente

removed unused smartcollection.products endpoint

Alex Gout 5 anni fa
parent
commit
7bbd8896ec

+ 2 - 6
lib/shopify_api/resources/smart_collection.rb

@@ -3,12 +3,8 @@ module ShopifyAPI
     include Events
     include Metafields
 
-    def products(options = {})
-      if options.present?
-        Product.find(:all, from: "#{self.class.prefix}smart_collections/#{id}/products.json", params: options)
-      else
-        Product.find(:all, params: { collection_id: id })
-      end
+    def products
+      Product.find(:all, params: { collection_id: id })
     end
 
     def order(options={})

+ 0 - 25
test/smart_collection_test.rb

@@ -7,29 +7,4 @@ class SmartCollectionTest < Test::Unit::TestCase
     smart_collection = ShopifyAPI::SmartCollection.create(:title => "Macbooks", :rules => rules)
     assert_equal 1063001432, smart_collection.id
   end
-
-  test "Smart Collection get products gets all products in a smart collection" do
-    fake "smart_collections/1063001432", method: :get, status: 200, body: load_fixture('smart_collection')
-    smart_collection = ShopifyAPI::SmartCollection.find(1063001432)
-
-    fake "products.json?collection_id=1063001432",
-      method: :get,
-      status: 200,
-      body:
-      load_fixture('smart_collection_products'),
-      extension: false
-    assert_equal [632910392, 921728736], smart_collection.products.map(&:id)
-  end
-
-  test "Smart Collection get products with only_sorted=only_manual gets only manually sorted products" do
-    fake "smart_collections/1063001432", method: :get, status: 200, body: load_fixture('smart_collection')
-    smart_collection = ShopifyAPI::SmartCollection.find(1063001432)
-
-    fake "smart_collections/1063001432/products.json?only_sorted=only_manual",
-      method: :get,
-      status: 200,
-      body: load_fixture('smart_collection_products'),
-      extension: false
-    assert_equal [632910392, 921728736], smart_collection.products(only_sorted: "only_manual").map(&:id)
-  end
 end