This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var randomWord = require('wiki-random-word'), | |
facebook = require('facebook'); | |
randomWord.then(facebook.postToMyWall); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var every = require('every'). | |
randomWikiWord = require('./word-of-day'). | |
automon = require('automon'); | |
automon.config = require('./config.json') | |
every('day', randomWikiWord); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mixin fieldGroup(model, name, label, type) | |
-var type =type || text | |
div.field-group(data-field=name) | |
label= label | |
if type!= 'textarea' | |
input(type=type, name=name, value=model[name]()) | |
else | |
textarea(name=name, value=model[name]()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var emailer = require('emailer'), | |
sms = require('sms'); | |
module.exports = function(notice) { | |
sms.sendText(notice); | |
emailer.sendEmail(notice); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Curate = require('curate'), | |
User = require('user-model'); | |
// Config would actually happen elsewhere | |
Curate.namespace = '/api/v1/'; | |
var UserQueries = module.exports = {}; | |
UserQueries.namespace = '/users'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var userRegistration = browser.findElement(By.id('username-registration')), | |
facebookRegistration = browser.findElement(By.id('facebook-registration')); | |
browser.getTitle().then(function(title) { | |
expect(title).to.be('WomStreet'); | |
}); | |
userRegistration.isDisplayed().then(function(result) { | |
expect(result).to.not.be.ok(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function populateAttributesFromObject(obj) { | |
$el.attr('name', obj['name']) | |
.attr('type', obj['type']); | |
... etc etc | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var View = exports.View = function(options) { | |
this._template = options.template || ''; | |
} | |
View.prototype.render: function() { | |
var read = require('fs').readFileSync; | |
jade.render(read(this._template)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var expect = require('expect.js'); | |
var sync = require('../'); | |
var User = require('modella')('User').attr('id').attr('name'); | |
var superagent = require('superagent'); | |
User.use(sync('/users')); | |
describe("Ajax Sync", function() { | |
it("sets sync", function() { | |
expect(User.sync).to.be.ok(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("passes along data from superagent", function(done) { | |
var oldFn = superagent.get; | |
superagent.get = function(url, cb) { | |
cb({error: null, body: [{id: "0", name: "Bob"}, {id: "1", name: "Tobi"}]}); | |
}; | |
User.sync.all(function(err, body) { | |
should.not.exist(err); | |
body.length.should.eq(2); | |
superagent.get = oldFn; |