Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added cookie construction test.

  • Loading branch information...
commit f191094258cdb323d9973d6294e19d1305cef5b5 1 parent fca2660
@tuxychandru authored
Showing with 20 additions and 0 deletions.
  1. +19 −0 test/simple/cookie-test.js
  2. +1 −0  test/simple/test.js
View
19 test/simple/cookie-test.js
@@ -0,0 +1,19 @@
+var Cookie = require('../../grasshopper/lib/cookie').api.Cookie,
+ assert = require('assert');
+
+var suite = {name: 'Cookie Tests'};
+exports.suite = suite;
+
+suite.tests = {
+ 'Cookie construction.': function(next) {
+ var c = new Cookie('language', 'JS');
+ assert.equal(c.name, 'language');
+ assert.equal(c.value, 'JS');
+ assert.equal(c.path, '/');
+ assert.equal(c.httpOnly, true);
+ next();
+ }
+};
+
+if(process.argv[1] == __filename)
+ require('../common/ghunit').test(suite);
View
1  test/simple/test.js
@@ -8,6 +8,7 @@ var suites = [
require('./routes-test').suite,
require('./wrapper-test').suite,
require('./params-test').suite,
+ require('./cookie-test').suite,
require('./context-test').suite
];
Please sign in to comment.
Something went wrong with that request. Please try again.