\ No newline at end of file
diff -r d7a7d7216371 -r f5a7299bd0ff unittests/tests/JSONSerializer.js
--- a/unittests/tests/JSONSerializer.js Thu Oct 13 17:12:52 2011 +0200
+++ b/unittests/tests/JSONSerializer.js Thu Oct 13 17:13:44 2011 +0200
@@ -13,7 +13,7 @@
equal(serializer.serialize(arr), JSON.stringify(arr), "assert that the outputted json is correct");
});
- test("sync() - callback should get called", function() {
+ test("sync()", function() {
this.xhr = this.sandbox.useFakeXMLHttpRequest();
this.requests = [];
this.xhr.onCreate = function (request) {
@@ -37,4 +37,11 @@
deepEqual(ser._data, response_array, "the internal variable is initialized to the correct value");
});
+ test("currentMedia should return the current media", function() {
+ var ser = new IriSP.JSONSerializer(this.dt, "/url");
+ /* FIXME: actually get something instead of monkey-patching the struct */
+ ser._data = {}
+ ser._data.medias = [0];
+ equal(ser.currentMedia(), 0, "currentMedia() returns the correct value");
+ });
};
\ No newline at end of file
diff -r d7a7d7216371 -r f5a7299bd0ff unittests/tests/dataloader.js
--- a/unittests/tests/dataloader.js Thu Oct 13 17:12:52 2011 +0200
+++ b/unittests/tests/dataloader.js Thu Oct 13 17:13:44 2011 +0200
@@ -34,7 +34,9 @@
ok(spy_callback.calledOnce, "callback called");
ok(spy_callback.calledWith(response_array), "callback called with correct string");
- deepEqual(dt._cache["/url"], response_array, "the response should be stored in the cache");
+
+ // FIXME : remove or activate this test.
+ //deepEqual(dt._cache["/url"], response_array, "the response should be stored in the cache");
});
}
\ No newline at end of file