You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by benkeen <gi...@git.apache.org> on 2014/11/03 20:32:00 UTC
[GitHub] couchdb-fauxton pull request: Added getter/setter utils.js methods...
GitHub user benkeen opened a pull request:
https://github.com/apache/couchdb-fauxton/pull/127
Added getter/setter utils.js methods for local storage
This is primarily proactive; there are only a couple of places in the code
that use local storage, but I wanted to nip it in the bud now and use
helpers instead.
Closes COUCHDB-2432
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/benkeen/couchdb-fauxton 2432-local-storage-methods-moved-to-utils
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-fauxton/pull/127.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #127
----
commit 2875d534eb88d8fcced839e4e2d02624980efc8c
Author: Benjamin Keen <be...@gmail.com>
Date: 2014-11-03T19:28:32Z
Added getter/setter utils.js methods for local storage
This is primarily proactive; there are only a couple of places in the code
that use local storage, but I wanted to nip it in the bud now and use
helpers instead.
Closes COUCHDB-2432
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request: Added getter/setter utils.js methods...
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/127#issuecomment-61618111
Yes it makes reviewing very easy :)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request: Added getter/setter utils.js methods...
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/127#issuecomment-61568134
tests tests tests! that is so super awesome @benkeen ! :dancer:
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request: Added getter/setter utils.js methods...
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/127#discussion_r19775318
--- Diff: app/core/tests/utilsSpec.js ---
@@ -0,0 +1,46 @@
+// 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',
+ 'testUtils',
+ 'core/utils'
+], function (FauxtonAPI, testUtils, utils) {
+ var assert = testUtils.assert;
+
+ describe("Utils", function () {
+
+ describe('localStorage', function () {
+
+ it ("Should get undefined when getting a non-existent key", function () {
+ assert.isUndefined(utils.localStorageGet('qwerty'));
+ });
+
+ it ("Should get value after setting it", function () {
+ var key = 'key1';
+ utils.localStorageSet(key, 1);
+ assert.equal(utils.localStorageGet(key), 1);
+ });
+
+ it ("Set complex object", function () {
+ var key = 'key2',
+ obj = {
+ one: 1,
+ two: ["1", "string", 3]
+ };
+ utils.localStorageSet(key, obj);
+ assert.deepEqual(utils.localStorageGet(key), obj);
+ });
+
+ });
+ });
+
+});
--- End diff --
`it (` -> `it(` as it is a call.
If you want, do a search & replace for `"` to `'`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request: Added getter/setter utils.js methods...
Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/127#issuecomment-61590748
haha :) I know what to do for your birthday: write more tests!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request: Added getter/setter utils.js methods...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/couchdb-fauxton/pull/127
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---