Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
add newsletter field to data model
Browse files Browse the repository at this point in the history
  • Loading branch information
zaach committed Dec 12, 2012
1 parent f1e7103 commit 5839bc3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/api/v1/account.js
Expand Up @@ -14,8 +14,9 @@ module.exports = {
}, },
description: 'Stage a new account', description: 'Stage a new account',
schema: { schema: {
email: B(), email: S(),
pass: S() pass: S(),
newsletter: B()
}, },
response: { response: {
success: B() success: B()
Expand Down
1 change: 1 addition & 0 deletions lib/db/couchbase.js
Expand Up @@ -17,6 +17,7 @@ module.exports = {
var account = { var account = {
pass: data.pass, pass: data.pass,
email: data.email, email: data.email,
newsletter: !!data.newsletter,
staged: true staged: true
}; };
db.set(data.email, account, function (err, meta) { db.set(data.email, account, function (err, meta) {
Expand Down
2 changes: 1 addition & 1 deletion lib/db/json.js
Expand Up @@ -13,8 +13,8 @@ module.exports = {
var account = { var account = {
pass: data.pass, pass: data.pass,
email: data.email, email: data.email,
newsletter: !!data.newsletter,
staged: false staged: false
//staged: true
}; };
setTimeout(function() { setTimeout(function() {
db[data.email] = account; db[data.email] = account;
Expand Down
3 changes: 2 additions & 1 deletion test/api.v1.account.js
Expand Up @@ -22,7 +22,8 @@ describe('/api/v1/account', function() {
it('staging should return success', function(done) { it('staging should return success', function(done) {
client.account({ client.account({
email: 'foo', email: 'foo',
pass: 'bar' pass: 'bar',
newsletter: false
}, function(err, r) { }, function(err, r) {
should.not.exist(err); should.not.exist(err);
should.exist(r); should.exist(r);
Expand Down

0 comments on commit 5839bc3

Please sign in to comment.