couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [19/50] [abbrv] fauxton commit: updated refs/heads/import-master to b32c617
Date Tue, 01 Apr 2014 09:14:35 GMT
Fauxton: add tests for config


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

Branch: refs/heads/import-master
Commit: 4266f84f9e2d321c7f4c9153ada0268fec642d8f
Parents: d7062db
Author: Robert Kowalski <rok@kowalski.gd>
Authored: Tue Mar 11 19:48:57 2014 +0100
Committer: suelockwood <deathbear@apache.org>
Committed: Thu Mar 13 10:43:23 2014 -0400

----------------------------------------------------------------------
 app/addons/config/tests/resourcesSpec.js | 57 +++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/4266f84f/app/addons/config/tests/resourcesSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/config/tests/resourcesSpec.js b/app/addons/config/tests/resourcesSpec.js
new file mode 100644
index 0000000..98f6569
--- /dev/null
+++ b/app/addons/config/tests/resourcesSpec.js
@@ -0,0 +1,57 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+define([
+      'api',
+      'addons/config/resources',
+      'testUtils'
+], function (FauxtonAPI, Resources, testUtils) {
+  var assert = testUtils.assert,
+      ViewSandbox = testUtils.ViewSandbox;
+
+  describe("ViewItem", function () {
+    var tabMenu, optionModel;
+
+    beforeEach(function () {
+      optionModel = new Resources.OptionModel({
+        section: "foo",
+        name: "bar"
+      });
+
+      tabMenu = new Resources.ViewItem({
+        model: optionModel
+      });
+    });
+
+    describe("editing Items", function () {
+      var viewSandbox;
+      beforeEach(function () {
+        viewSandbox = new ViewSandbox();
+        viewSandbox.renderView(tabMenu);
+      });
+
+      afterEach(function () {
+        viewSandbox.remove();
+      });
+
+      it("click on save should save the model and render", function () {
+        var renderSpy = sinon.stub(tabMenu, 'render');
+        var saveSpy = sinon.stub(optionModel, 'save');
+
+        tabMenu.$('.js-edit-value').trigger('dblclick');
+        tabMenu.$('.js-save-value').trigger('click');
+
+        assert.ok(renderSpy.calledOnce);
+        assert.ok(saveSpy.calledOnce);
+      });
+    });
+  });
+});


Mime
View raw message