Selaa lähdekoodia

Add Collect tests

Julio Napurí 9 vuotta sitten
vanhempi
commit
f770b2de5f
2 muutettua tiedostoa jossa 21 lisäystä ja 0 poistoa
  1. 9 0
      test/collect_test.rb
  2. 12 0
      test/fixtures/collect.json

+ 9 - 0
test/collect_test.rb

@@ -0,0 +1,9 @@
+require 'test_helper'
+
+class CollectTest < Test::Unit::TestCase
+  test "#create should create a collect" do
+    fake "collects", :method => :post, :status => 201, :body => load_fixture('collect')
+    link = ShopifyAPI::Collect.create(:product_id => 921728736, :collection_id => 841564295)
+    assert_equal 841564295, link.id
+  end
+end

+ 12 - 0
test/fixtures/collect.json

@@ -0,0 +1,12 @@
+{
+  "collect": {
+    "id": 841564295,
+    "collection_id": 841564295,
+    "product_id": 632910392,
+    "featured": false,
+    "created_at": null,
+    "updated_at": null,
+    "position": 1,
+    "sort_value": "0000000001"
+  }
+}