summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lib/promise.js1
-rw-r--r--test/test/01-product.js14
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()
+ })
+ })
+ })
+
})