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
actionArray = [ | |
function one(cb) { | |
someAsyncFunction(params, function(err, results) { | |
if (err) { | |
cb(new Error(“There was an error”)); | |
} | |
console.log(“one”); | |
cb(null); | |
}); | |
}, |
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
{ | |
first_name: “Paul”, | |
surname: “Miller”, | |
city: “London”, | |
location: [45.123,47.232], | |
cars: [ | |
{ model: “Bentley”, | |
year: 1973, | |
value: 100000, ….}, | |
{ model: “Rolls Royce”, |
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
module.exports = { | |
url : 'http://localhost:8000/api/v1.0' | |
} |
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 connectDB(callback) { | |
mongoClient.connect(dbConfig.testDBURL, function(err, db) { | |
assert.equal(null, err); | |
reader_test_db = db; | |
console.log("Connected correctly to server"); | |
callback(0); | |
}); | |
} |
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 dropUserFeedEntryCollection(callback) { | |
console.log("dropUserFeedEntryCollection"); | |
user_feed_entry = reader_test_db.collection('user_feed_entry'); | |
if (undefined != user_feed_entry) { | |
user_feed_entry.drop(function(err, reply) { | |
console.log('user_feed_entry collection dropped'); | |
callback(0); | |
}); | |
} else { | |
callback(0); |
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 getApplication(callback) { | |
console.log("getApplication"); | |
client.getApplications({ | |
name: SP_APP_NAME | |
}, function(err, applications) { | |
console.log(applications); | |
if (err) { | |
log("Error in getApplications"); | |
throw err; | |
} |
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 closeDB(callback) { | |
reader_test_db.close(); | |
} |
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
async.series([connectDB, dropUserCollection, dropUserFeedEntryCollection, dropUserFeedEntryCollection, getApplication, deleteTestAccounts, closeDB]); |
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
TU1_FN = "Test"; | |
TU1_LN = "User1"; | |
TU1_EMAIL = "testuser1@example.com"; | |
TU1_PW = "testUser123"; | |
TU_EMAIL_REGEX = 'testuser*'; | |
SP_APP_NAME = 'Reader Test'; | |
var frisby = require('frisby'); | |
var tc = require('./config/test_config'); |
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
frisby.create('POST missing firstName') | |
.post(tc.url + '/user/enroll', | |
{ 'lastName' : TU1_LN, | |
'email' : TU1_EMAIL, | |
'password' : TU1_PW }) | |
.expectStatus(400) | |
.expectHeader('Content-Type', 'application/json; charset=utf-8') | |
.expectJSON({'error' : 'Undefined First Name'}) | |
.toss() |
OlderNewer