couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [1/7] fauxton commit: updated refs/heads/master to 6c9a5a6
Date Tue, 26 Aug 2014 16:24:10 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 895d13c42 -> 6c9a5a643


Fix failing tests


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/a94f56f0
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/a94f56f0
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/a94f56f0

Branch: refs/heads/master
Commit: a94f56f041d62a3f7a2389986de71a167e18f27b
Parents: 6f145e8
Author: Garren Smith <garren.smith@gmail.com>
Authored: Tue Aug 26 11:07:32 2014 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Tue Aug 26 18:22:41 2014 +0200

----------------------------------------------------------------------
 app/addons/fauxton/tests/baseSpec.js |  6 +++++-
 app/core/tests/routeObjectSpec.js    | 22 ++++++++++++++++++----
 2 files changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a94f56f0/app/addons/fauxton/tests/baseSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/tests/baseSpec.js b/app/addons/fauxton/tests/baseSpec.js
index b9814bc..7ecb1a0 100644
--- a/app/addons/fauxton/tests/baseSpec.js
+++ b/app/addons/fauxton/tests/baseSpec.js
@@ -41,7 +41,11 @@ define([
 
       // Need to find a better way of doing this
       mockLayout = {
-        setTemplate: sinon.spy(),
+        setTemplate: function () { 
+          var promise = $.Deferred();
+          promise.resolve();
+          return promise;
+        },
         clearBreadcrumbs: sinon.spy(),
         setView: setViewSpy,
         renderView: sinon.spy(),

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a94f56f0/app/core/tests/routeObjectSpec.js
----------------------------------------------------------------------
diff --git a/app/core/tests/routeObjectSpec.js b/app/core/tests/routeObjectSpec.js
index f3f4b48..5e5aa49 100644
--- a/app/core/tests/routeObjectSpec.js
+++ b/app/core/tests/routeObjectSpec.js
@@ -32,7 +32,11 @@ define([
 
         // Need to find a better way of doing this
         mockLayout = {
-          setTemplate: sinon.spy(),
+          setTemplate: function () { 
+            var promise = $.Deferred();
+            promise.resolve();
+            return promise;
+          },
           clearBreadcrumbs: sinon.spy(),
           setView: sinon.spy(),
           renderView: sinon.spy(),
@@ -44,17 +48,27 @@ define([
       });
 
       it('Should set template for first render ', function () {
+        var setTemplateSpy = sinon.stub(mockLayout, 'setTemplate'),
+            promise = $.Deferred();
+
+        promise.resolve();
+        setTemplateSpy.returns(promise);
         testRouteObject.renderWith('the-route', mockLayout, 'args');
 
-        assert.ok(mockLayout.setTemplate.calledOnce, 'setTempalte was called');
+        assert.ok(setTemplateSpy.calledOnce, 'setTempalte was called');
       });
 
       it('Should not set template after first render', function () {
-        testRouteObject.renderWith('the-route', mockLayout, 'args');
+        var setTemplateSpy = sinon.stub(mockLayout, 'setTemplate'),
+            promise = $.Deferred();
 
+        promise.resolve();
+        setTemplateSpy.returns(promise);
+
+        testRouteObject.renderWith('the-route', mockLayout, 'args');
         testRouteObject.renderWith('the-route', mockLayout, 'args');
 
-        assert.ok(mockLayout.setTemplate.calledOnce, 'SetTemplate not meant to be called');
+        assert.ok(setTemplateSpy.calledOnce, 'SetTemplate not meant to be called');
       });
 
       


Mime
View raw message