diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-09 16:21:27 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-09 16:21:27 -0500 |
| commit | 6a8e38d24c4866b8559f7116eac694fbf1da4ded (patch) | |
| tree | b45774ad4cec0fa214f59a0e8609ef12c0273125 /test | |
| parent | aa93b03e1862e9f95570653d52b9d5858171d22f (diff) | |
profile html, search api
Diffstat (limited to 'test')
| -rw-r--r-- | test/lib/promise.js | 1 | ||||
| -rw-r--r-- | test/test/01-product.js | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/test/lib/promise.js b/test/lib/promise.js index a3638de4..c239f306 100644 --- a/test/lib/promise.js +++ b/test/lib/promise.js @@ -1,5 +1,6 @@ module.exports = function(fn, data){ var my_cb, my_res, error_cb, my_error + data = data || {} data.success = function(res){ my_res = res if (my_cb) { diff --git a/test/test/01-product.js b/test/test/01-product.js index 983532d7..365e1581 100644 --- a/test/test/01-product.js +++ b/test/test/01-product.js @@ -10,7 +10,7 @@ describe('product', function(){ describe('#collection()', function(){ it('returns a collection', function(done){ - promise(sdk.product.collection, { gallery_id: 31617 }).then(function(data){ + promise(sdk.product.collection).then(function(data){ assert(data.Header.StatusCode == 200) assert(data.SearchResponseFull.Results.Items.length > 0) test_item = data.SearchResponseFull.Results.Items[0] @@ -31,5 +31,17 @@ describe('product', function(){ }) }) + describe('#search()', function(){ + it('finds products', function(done){ + promise(sdk.product.search, { query: "jacket" }).then(function(data){ + assert(data.Header.StatusCode == 200) + assert(data.SearchResponseFull.Results.Items.length > 0) + done() + }).error(function(error){ + done() + }) + }) + }) + }) |
