added coveralls support to travis-ci script
This commit is contained in:
parent
73c87a2301
commit
fb6601fcf6
|
@ -5,6 +5,7 @@ Current stable release: v1.2.1
|
|||
|
||||
[![Build Status](https://travis-ci.org/whitef0x0/tellform.svg?branch=master)](https://travis-ci.org/whitef0x0/tellform)
|
||||
[![Dependencies Status](https://david-dm.org/whitef0x0/tellform.svg)](https://david-dm.org/whitef0x0/tellform)
|
||||
[![devDependency Status](https://david-dm.org/whitef0x0/tellform/dev-status.svg)](https://david-dm.org/whitef0x0/tellform#info=devDependencies)
|
||||
[![Coverage Status](https://coveralls.io/repos/whitef0x0/tellform/badge.svg?branch=master&service=github)](https://coveralls.io/github/whitef0x0/tellform?branch=master)
|
||||
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ var BooleanExpressionSchema = new Schema({
|
|||
|
||||
|
||||
BooleanExpressionSchema.methods.evaluate = function(){
|
||||
if(this.expressionString)
|
||||
if(this.expressionString){
|
||||
//Get headNode
|
||||
var headNode = math.parse(this.expressionString);
|
||||
var expressionScope = {};
|
||||
|
|
|
@ -72,7 +72,8 @@ describe('Form Model Unit Tests:', function() {
|
|||
provider: 'local'
|
||||
});
|
||||
|
||||
user.save(function() {
|
||||
user.save(function(err) {
|
||||
if(err) return done(err);
|
||||
myForm = new Form({
|
||||
title: 'Form Title',
|
||||
admin: user,
|
||||
|
|
|
@ -63,51 +63,57 @@ describe('Form Routes Unit tests', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should be able to save a Form if logged in', function(done) {
|
||||
userSession.post('/auth/signin')
|
||||
.send(credentials)
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(200)
|
||||
.end(function(signinErr, signinRes) {
|
||||
describe(' > Login as user and Save a new Form', function() {
|
||||
var _user, _form;
|
||||
before('login as a user', function(done){
|
||||
userSession.post('/auth/signin')
|
||||
.send(credentials)
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(200, 'Could not login user')
|
||||
.end(function(signinErr, signinRes) {
|
||||
|
||||
// Handle signin error
|
||||
if (signinErr) done(signinErr);
|
||||
// Handle signin error
|
||||
if (signinErr) done(signinErr);
|
||||
|
||||
var user = signinRes.body;
|
||||
var userId = user._id;
|
||||
_user = signinRes.body;
|
||||
done();
|
||||
});
|
||||
});
|
||||
it(' > should be able to save a Form as a user', function(done){
|
||||
// Save a new Form
|
||||
userSession.post('/forms')
|
||||
.send({form: myForm})
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(200, 'Could not save new Form')
|
||||
.end(function(FormSaveErr, FormSaveRes) {
|
||||
// Handle Form save error
|
||||
if (FormSaveErr) done(FormSaveErr);
|
||||
_form = FormSaveRes.body;
|
||||
done();
|
||||
});
|
||||
});
|
||||
it(' > should be able to fetch newly created form', function(done){
|
||||
|
||||
// Save a new Form
|
||||
userSession.post('/forms')
|
||||
.send({form: myForm})
|
||||
// Get a list of Forms
|
||||
userSession.get('/forms/'+_form._id)
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(200)
|
||||
.end(function(FormSaveErr, FormSaveRes) {
|
||||
.end(function(FormsGetErr, FormsGetRes) {
|
||||
// Handle Form save error
|
||||
if (FormSaveErr) done(FormSaveErr);
|
||||
if (FormsGetErr) done(FormsGetErr);
|
||||
|
||||
// Get a list of Forms
|
||||
userSession.get('/forms')
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(200)
|
||||
.end(function(FormsGetErr, FormsGetRes) {
|
||||
// Handle Form save error
|
||||
if (FormsGetErr) done(FormsGetErr);
|
||||
var fetchedForm = FormsGetRes.body;
|
||||
// Set assertions
|
||||
(fetchedForm.admin).should.equal(_user._id);
|
||||
(fetchedForm.title).should.match(_form.title);
|
||||
|
||||
// Get Forms list
|
||||
var Forms = FormsGetRes.body;
|
||||
|
||||
// Set assertions
|
||||
(Forms[0].admin).should.equal(userId);
|
||||
(Forms[0].title).should.match('Form Title');
|
||||
|
||||
// Call the assertion callback
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
// Call the assertion callback
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should not be able to create a Form if not logged in', function(done) {
|
||||
it(' > should not be able to create a Form if not logged in', function(done) {
|
||||
userSession.post('/forms')
|
||||
.send({form: myForm})
|
||||
.expect(401)
|
||||
|
@ -118,7 +124,7 @@ describe('Form Routes Unit tests', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should not be able to get list of users\' Forms if not logged in', function(done) {
|
||||
it(' > should not be able to get list of users\' Forms if not logged in', function(done) {
|
||||
userSession.get('/forms')
|
||||
.expect(401)
|
||||
.end(function(FormSaveErr, FormSaveRes) {
|
||||
|
@ -128,7 +134,7 @@ describe('Form Routes Unit tests', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should not be able to save a Form if no title is provided', function(done) {
|
||||
it(' > should not be able to save a Form if no title is provided', function(done) {
|
||||
// Set Form with a invalid title field
|
||||
myForm.title = '';
|
||||
|
||||
|
@ -153,7 +159,7 @@ describe('Form Routes Unit tests', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should be able to update a Form if signed in', function(done) {
|
||||
it(' > should be able to update a Form if signed in', function(done) {
|
||||
userSession.post('/auth/signin')
|
||||
.send(credentials)
|
||||
.expect('Content-Type', /json/)
|
||||
|
@ -194,7 +200,7 @@ describe('Form Routes Unit tests', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should be able to read/get a Form if not signed in', function(done) {
|
||||
it(' > should be able to read/get a Form if not signed in', function(done) {
|
||||
// Create new Form model instance
|
||||
var FormObj = new Form(myForm);
|
||||
|
||||
|
@ -246,7 +252,8 @@ describe('Form Routes Unit tests', function() {
|
|||
if (FormDeleteErr) done(FormDeleteErr);
|
||||
|
||||
// Set assertions
|
||||
(FormDeleteRes.body._id).should.equal(FormSaveRes.body._id);
|
||||
(FormDeleteRes.body).should.exist();
|
||||
// (FormDeleteRes.body._id).should.equal(FormSaveRes.body._id);
|
||||
|
||||
// Call the assertion callback
|
||||
done();
|
||||
|
@ -256,7 +263,7 @@ describe('Form Routes Unit tests', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should not be able to delete an Form if not signed in', function(done) {
|
||||
it(' > should not be able to delete an Form if not signed in', function(done) {
|
||||
// Set Form user
|
||||
myForm.admin = user;
|
||||
|
||||
|
@ -280,7 +287,7 @@ describe('Form Routes Unit tests', function() {
|
|||
});
|
||||
|
||||
|
||||
it('should be able to upload a PDF an Form if logged in', function(done) {
|
||||
it(' > should be able to upload a PDF an Form if logged in', function(done) {
|
||||
userSession.post('/auth/signin')
|
||||
.send(credentials)
|
||||
.expect('Content-Type', /json/)
|
||||
|
@ -327,7 +334,7 @@ describe('Form Routes Unit tests', function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe('Form Submission tests', function() {
|
||||
describe('> Form Submission tests', function() {
|
||||
var FormObj, _Submission, submissionSession;
|
||||
|
||||
beforeEach(function (done) {
|
||||
|
@ -358,7 +365,7 @@ describe('Form Routes Unit tests', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should be able to create a Form Submission without signing in', function(done) {
|
||||
it(' > should be able to create a Form Submission without signing in', function(done) {
|
||||
|
||||
//Create Submission
|
||||
submissionSession.post('/forms/' + FormObj._id)
|
||||
|
@ -372,7 +379,7 @@ describe('Form Routes Unit tests', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should be able to get Form Submissions if signed in', function(done) {
|
||||
it(' > should be able to get Form Submissions if signed in', function(done) {
|
||||
submissionSession.post('/auth/signin')
|
||||
.send(credentials)
|
||||
.expect('Content-Type', /json/)
|
||||
|
@ -404,7 +411,7 @@ describe('Form Routes Unit tests', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should not be able to get Form Submissions if not signed in', function(done) {
|
||||
it(' > should not be able to get Form Submissions if not signed in', function(done) {
|
||||
// Attempt to fetch form submissions
|
||||
submissionSession.get('/forms/' + FormObj._id + '/submissions')
|
||||
.expect(401)
|
||||
|
@ -418,7 +425,7 @@ describe('Form Routes Unit tests', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should not be able to delete Form Submission if not signed in', function(done) {
|
||||
it(' > should not be able to delete Form Submission if not signed in', function(done) {
|
||||
var SubmissionObj = new FormSubmission(_Submission);
|
||||
|
||||
SubmissionObj.save(function (err, submission) {
|
||||
|
@ -442,7 +449,7 @@ describe('Form Routes Unit tests', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should be able to delete Form Submission if signed in', function(done) {
|
||||
it(' > should be able to delete Form Submission if signed in', function(done) {
|
||||
// Create new FormSubmission model instance
|
||||
var SubmissionObj = new FormSubmission(_Submission);
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@ describe('FormSubmission Model Unit Tests:', function() {
|
|||
if(err){
|
||||
console.log(err.errors);
|
||||
done(err);
|
||||
return;
|
||||
}
|
||||
myForm = new Form({
|
||||
title: 'Form Title1',
|
||||
|
@ -108,7 +109,7 @@ describe('FormSubmission Model Unit Tests:', function() {
|
|||
myForm.save(function(err, form){
|
||||
if(err){
|
||||
console.log(err.errors);
|
||||
done(err);
|
||||
return done(err);
|
||||
}
|
||||
|
||||
var submissionFields = _.clone(myForm.form_fields);
|
||||
|
@ -143,14 +144,14 @@ describe('FormSubmission Model Unit Tests:', function() {
|
|||
myForm.plugins.oscarhost.settings.fieldMap = myFieldMap;
|
||||
|
||||
myForm.save(function(err, form){
|
||||
if(err) done(err);
|
||||
if(err) return done(err);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should be able to save a FormSubmission without problems', function(done) {
|
||||
return mySubmission.save(function(err, submission) {
|
||||
if(err) done(err);
|
||||
if(err) return done(err);
|
||||
|
||||
should.not.exist(err);
|
||||
should.exist(submission);
|
||||
|
@ -251,7 +252,7 @@ describe('FormSubmission Model Unit Tests:', function() {
|
|||
});
|
||||
|
||||
mySubmission.save(function(err){
|
||||
if(err) done(err);
|
||||
if(err) return done(err);
|
||||
done();
|
||||
});
|
||||
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
// 'use strict';
|
||||
'use strict';
|
||||
|
||||
// /**
|
||||
// * Module dependencies.
|
||||
// */
|
||||
// var passport = require('passport'),
|
||||
// FacebookStrategy = require('passport-facebook').Strategy,
|
||||
// config = require('../config'),
|
||||
// users = require('../../app/controllers/users.server.controller');
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
var passport = require('passport'),
|
||||
FacebookStrategy = require('passport-facebook').Strategy,
|
||||
config = require('../config'),
|
||||
users = require('../../app/controllers/users.server.controller');
|
||||
|
||||
// module.exports = function() {
|
||||
// // Use facebook strategy
|
||||
// passport.use(new FacebookStrategy({
|
||||
// clientID: config.facebook.clientID,
|
||||
// clientSecret: config.facebook.clientSecret,
|
||||
// callbackURL: config.facebook.callbackURL,
|
||||
// passReqToCallback: true
|
||||
// },
|
||||
// function(req, accessToken, refreshToken, profile, done) {
|
||||
// // Set the provider data and include tokens
|
||||
// var providerData = profile._json;
|
||||
// providerData.accessToken = accessToken;
|
||||
// providerData.refreshToken = refreshToken;
|
||||
module.exports = function() {
|
||||
// Use facebook strategy
|
||||
passport.use(new FacebookStrategy({
|
||||
clientID: config.facebook.clientID,
|
||||
clientSecret: config.facebook.clientSecret,
|
||||
callbackURL: config.facebook.callbackURL,
|
||||
passReqToCallback: true
|
||||
},
|
||||
function(req, accessToken, refreshToken, profile, done) {
|
||||
// Set the provider data and include tokens
|
||||
var providerData = profile._json;
|
||||
providerData.accessToken = accessToken;
|
||||
providerData.refreshToken = refreshToken;
|
||||
|
||||
// // Create the user OAuth profile
|
||||
// var providerUserProfile = {
|
||||
// firstName: profile.name.givenName,
|
||||
// lastName: profile.name.familyName,
|
||||
// displayName: profile.displayName,
|
||||
// email: profile.emails[0].value,
|
||||
// username: profile.username,
|
||||
// provider: 'facebook',
|
||||
// providerIdentifierField: 'id',
|
||||
// providerData: providerData
|
||||
// };
|
||||
// Create the user OAuth profile
|
||||
var providerUserProfile = {
|
||||
firstName: profile.name.givenName,
|
||||
lastName: profile.name.familyName,
|
||||
displayName: profile.displayName,
|
||||
email: profile.emails[0].value,
|
||||
username: profile.username,
|
||||
provider: 'facebook',
|
||||
providerIdentifierField: 'id',
|
||||
providerData: providerData
|
||||
};
|
||||
|
||||
// // Save the user OAuth profile
|
||||
// users.saveOAuthUserProfile(req, providerUserProfile, done);
|
||||
// }
|
||||
// ));
|
||||
// };
|
||||
// Save the user OAuth profile
|
||||
users.saveOAuthUserProfile(req, providerUserProfile, done);
|
||||
}
|
||||
));
|
||||
};
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
// 'use strict';
|
||||
'use strict';
|
||||
|
||||
// /**
|
||||
// * Module dependencies.
|
||||
// */
|
||||
// var passport = require('passport'),
|
||||
// GithubStrategy = require('passport-github').Strategy,
|
||||
// config = require('../config'),
|
||||
// users = require('../../app/controllers/users.server.controller');
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
var passport = require('passport'),
|
||||
GithubStrategy = require('passport-github').Strategy,
|
||||
config = require('../config'),
|
||||
users = require('../../app/controllers/users.server.controller');
|
||||
|
||||
// module.exports = function() {
|
||||
// // Use github strategy
|
||||
// passport.use(new GithubStrategy({
|
||||
// clientID: config.github.clientID,
|
||||
// clientSecret: config.github.clientSecret,
|
||||
// callbackURL: config.github.callbackURL,
|
||||
// passReqToCallback: true
|
||||
// },
|
||||
// function(req, accessToken, refreshToken, profile, done) {
|
||||
// // Set the provider data and include tokens
|
||||
// var providerData = profile._json;
|
||||
// providerData.accessToken = accessToken;
|
||||
// providerData.refreshToken = refreshToken;
|
||||
module.exports = function() {
|
||||
// Use github strategy
|
||||
passport.use(new GithubStrategy({
|
||||
clientID: config.github.clientID,
|
||||
clientSecret: config.github.clientSecret,
|
||||
callbackURL: config.github.callbackURL,
|
||||
passReqToCallback: true
|
||||
},
|
||||
function(req, accessToken, refreshToken, profile, done) {
|
||||
// Set the provider data and include tokens
|
||||
var providerData = profile._json;
|
||||
providerData.accessToken = accessToken;
|
||||
providerData.refreshToken = refreshToken;
|
||||
|
||||
// // Create the user OAuth profile
|
||||
// var displayName = profile.displayName.trim();
|
||||
// var iSpace = displayName.indexOf(' '); // index of the whitespace following the firstName
|
||||
// var firstName = iSpace !== -1 ? displayName.substring(0, iSpace) : displayName;
|
||||
// var lastName = iSpace !== -1 ? displayName.substring(iSpace + 1) : '';
|
||||
// Create the user OAuth profile
|
||||
var displayName = profile.displayName.trim();
|
||||
var iSpace = displayName.indexOf(' '); // index of the whitespace following the firstName
|
||||
var firstName = iSpace !== -1 ? displayName.substring(0, iSpace) : displayName;
|
||||
var lastName = iSpace !== -1 ? displayName.substring(iSpace + 1) : '';
|
||||
|
||||
// var providerUserProfile = {
|
||||
// firstName: firstName,
|
||||
// lastName: lastName,
|
||||
// displayName: displayName,
|
||||
// email: profile.emails[0].value,
|
||||
// username: profile.username,
|
||||
// provider: 'github',
|
||||
// providerIdentifierField: 'id',
|
||||
// providerData: providerData
|
||||
// };
|
||||
var providerUserProfile = {
|
||||
firstName: firstName,
|
||||
lastName: lastName,
|
||||
displayName: displayName,
|
||||
email: profile.emails[0].value,
|
||||
username: profile.username,
|
||||
provider: 'github',
|
||||
providerIdentifierField: 'id',
|
||||
providerData: providerData
|
||||
};
|
||||
|
||||
// // Save the user OAuth profile
|
||||
// users.saveOAuthUserProfile(req, providerUserProfile, done);
|
||||
// }
|
||||
// ));
|
||||
// };
|
||||
// Save the user OAuth profile
|
||||
users.saveOAuthUserProfile(req, providerUserProfile, done);
|
||||
}
|
||||
));
|
||||
};
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
// 'use strict';
|
||||
'use strict';
|
||||
|
||||
// /**
|
||||
// * Module dependencies.
|
||||
// */
|
||||
// var passport = require('passport'),
|
||||
// GoogleStrategy = require('passport-google-oauth').OAuth2Strategy,
|
||||
// config = require('../config'),
|
||||
// users = require('../../app/controllers/users.server.controller');
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
var passport = require('passport'),
|
||||
GoogleStrategy = require('passport-google-oauth').OAuth2Strategy,
|
||||
config = require('../config'),
|
||||
users = require('../../app/controllers/users.server.controller');
|
||||
|
||||
// module.exports = function() {
|
||||
// // Use google strategy
|
||||
// passport.use(new GoogleStrategy({
|
||||
// clientID: config.google.clientID,
|
||||
// clientSecret: config.google.clientSecret,
|
||||
// callbackURL: config.google.callbackURL,
|
||||
// passReqToCallback: true
|
||||
// },
|
||||
// function(req, accessToken, refreshToken, profile, done) {
|
||||
// // Set the provider data and include tokens
|
||||
// var providerData = profile._json;
|
||||
// providerData.accessToken = accessToken;
|
||||
// providerData.refreshToken = refreshToken;
|
||||
module.exports = function() {
|
||||
// Use google strategy
|
||||
passport.use(new GoogleStrategy({
|
||||
clientID: config.google.clientID,
|
||||
clientSecret: config.google.clientSecret,
|
||||
callbackURL: config.google.callbackURL,
|
||||
passReqToCallback: true
|
||||
},
|
||||
function(req, accessToken, refreshToken, profile, done) {
|
||||
// Set the provider data and include tokens
|
||||
var providerData = profile._json;
|
||||
providerData.accessToken = accessToken;
|
||||
providerData.refreshToken = refreshToken;
|
||||
|
||||
// // Create the user OAuth profile
|
||||
// var providerUserProfile = {
|
||||
// firstName: profile.name.givenName,
|
||||
// lastName: profile.name.familyName,
|
||||
// displayName: profile.displayName,
|
||||
// email: profile.emails[0].value,
|
||||
// username: profile.username,
|
||||
// provider: 'google',
|
||||
// providerIdentifierField: 'id',
|
||||
// providerData: providerData
|
||||
// };
|
||||
// Create the user OAuth profile
|
||||
var providerUserProfile = {
|
||||
firstName: profile.name.givenName,
|
||||
lastName: profile.name.familyName,
|
||||
displayName: profile.displayName,
|
||||
email: profile.emails[0].value,
|
||||
username: profile.username,
|
||||
provider: 'google',
|
||||
providerIdentifierField: 'id',
|
||||
providerData: providerData
|
||||
};
|
||||
|
||||
// // Save the user OAuth profile
|
||||
// users.saveOAuthUserProfile(req, providerUserProfile, done);
|
||||
// }
|
||||
// ));
|
||||
// };
|
||||
// Save the user OAuth profile
|
||||
users.saveOAuthUserProfile(req, providerUserProfile, done);
|
||||
}
|
||||
));
|
||||
};
|
||||
|
|
|
@ -1,42 +1,42 @@
|
|||
// 'use strict';
|
||||
'use strict';
|
||||
|
||||
// /**
|
||||
// * Module dependencies.
|
||||
// */
|
||||
// var passport = require('passport'),
|
||||
// LinkedInStrategy = require('passport-linkedin').Strategy,
|
||||
// config = require('../config'),
|
||||
// users = require('../../app/controllers/users.server.controller');
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
var passport = require('passport'),
|
||||
LinkedInStrategy = require('passport-linkedin').Strategy,
|
||||
config = require('../config'),
|
||||
users = require('../../app/controllers/users.server.controller');
|
||||
|
||||
// module.exports = function() {
|
||||
// // Use linkedin strategy
|
||||
// passport.use(new LinkedInStrategy({
|
||||
// consumerKey: config.linkedin.clientID,
|
||||
// consumerSecret: config.linkedin.clientSecret,
|
||||
// callbackURL: config.linkedin.callbackURL,
|
||||
// passReqToCallback: true,
|
||||
// profileFields: ['id', 'first-name', 'last-name', 'email-address']
|
||||
// },
|
||||
// function(req, accessToken, refreshToken, profile, done) {
|
||||
// // Set the provider data and include tokens
|
||||
// var providerData = profile._json;
|
||||
// providerData.accessToken = accessToken;
|
||||
// providerData.refreshToken = refreshToken;
|
||||
module.exports = function() {
|
||||
// Use linkedin strategy
|
||||
passport.use(new LinkedInStrategy({
|
||||
consumerKey: config.linkedin.clientID,
|
||||
consumerSecret: config.linkedin.clientSecret,
|
||||
callbackURL: config.linkedin.callbackURL,
|
||||
passReqToCallback: true,
|
||||
profileFields: ['id', 'first-name', 'last-name', 'email-address']
|
||||
},
|
||||
function(req, accessToken, refreshToken, profile, done) {
|
||||
// Set the provider data and include tokens
|
||||
var providerData = profile._json;
|
||||
providerData.accessToken = accessToken;
|
||||
providerData.refreshToken = refreshToken;
|
||||
|
||||
// // Create the user OAuth profile
|
||||
// var providerUserProfile = {
|
||||
// firstName: profile.name.givenName,
|
||||
// lastName: profile.name.familyName,
|
||||
// displayName: profile.displayName,
|
||||
// email: profile.emails[0].value,
|
||||
// username: profile.username,
|
||||
// provider: 'linkedin',
|
||||
// providerIdentifierField: 'id',
|
||||
// providerData: providerData
|
||||
// };
|
||||
// Create the user OAuth profile
|
||||
var providerUserProfile = {
|
||||
firstName: profile.name.givenName,
|
||||
lastName: profile.name.familyName,
|
||||
displayName: profile.displayName,
|
||||
email: profile.emails[0].value,
|
||||
username: profile.username,
|
||||
provider: 'linkedin',
|
||||
providerIdentifierField: 'id',
|
||||
providerData: providerData
|
||||
};
|
||||
|
||||
// // Save the user OAuth profile
|
||||
// users.saveOAuthUserProfile(req, providerUserProfile, done);
|
||||
// }
|
||||
// ));
|
||||
// };
|
||||
// Save the user OAuth profile
|
||||
users.saveOAuthUserProfile(req, providerUserProfile, done);
|
||||
}
|
||||
));
|
||||
};
|
||||
|
|
|
@ -1,45 +1,45 @@
|
|||
// 'use strict';
|
||||
'use strict';
|
||||
|
||||
// /**
|
||||
// * Module dependencies.
|
||||
// */
|
||||
// var passport = require('passport'),
|
||||
// TwitterStrategy = require('passport-twitter').Strategy,
|
||||
// config = require('../config'),
|
||||
// users = require('../../app/controllers/users.server.controller');
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
var passport = require('passport'),
|
||||
TwitterStrategy = require('passport-twitter').Strategy,
|
||||
config = require('../config'),
|
||||
users = require('../../app/controllers/users.server.controller');
|
||||
|
||||
// module.exports = function() {
|
||||
// // Use twitter strategy
|
||||
// passport.use(new TwitterStrategy({
|
||||
// consumerKey: config.twitter.clientID,
|
||||
// consumerSecret: config.twitter.clientSecret,
|
||||
// callbackURL: config.twitter.callbackURL,
|
||||
// passReqToCallback: true
|
||||
// },
|
||||
// function(req, token, tokenSecret, profile, done) {
|
||||
// // Set the provider data and include tokens
|
||||
// var providerData = profile._json;
|
||||
// providerData.token = token;
|
||||
// providerData.tokenSecret = tokenSecret;
|
||||
module.exports = function() {
|
||||
// Use twitter strategy
|
||||
passport.use(new TwitterStrategy({
|
||||
consumerKey: config.twitter.clientID,
|
||||
consumerSecret: config.twitter.clientSecret,
|
||||
callbackURL: config.twitter.callbackURL,
|
||||
passReqToCallback: true
|
||||
},
|
||||
function(req, token, tokenSecret, profile, done) {
|
||||
// Set the provider data and include tokens
|
||||
var providerData = profile._json;
|
||||
providerData.token = token;
|
||||
providerData.tokenSecret = tokenSecret;
|
||||
|
||||
// // Create the user OAuth profile
|
||||
// var displayName = profile.displayName.trim();
|
||||
// var iSpace = displayName.indexOf(' '); // index of the whitespace following the firstName
|
||||
// var firstName = iSpace !== -1 ? displayName.substring(0, iSpace) : displayName;
|
||||
// var lastName = iSpace !== -1 ? displayName.substring(iSpace + 1) : '';
|
||||
// Create the user OAuth profile
|
||||
var displayName = profile.displayName.trim();
|
||||
var iSpace = displayName.indexOf(' '); // index of the whitespace following the firstName
|
||||
var firstName = iSpace !== -1 ? displayName.substring(0, iSpace) : displayName;
|
||||
var lastName = iSpace !== -1 ? displayName.substring(iSpace + 1) : '';
|
||||
|
||||
// var providerUserProfile = {
|
||||
// firstName: firstName,
|
||||
// lastName: lastName,
|
||||
// displayName: displayName,
|
||||
// username: profile.username,
|
||||
// provider: 'twitter',
|
||||
// providerIdentifierField: 'id_str',
|
||||
// providerData: providerData
|
||||
// };
|
||||
var providerUserProfile = {
|
||||
firstName: firstName,
|
||||
lastName: lastName,
|
||||
displayName: displayName,
|
||||
username: profile.username,
|
||||
provider: 'twitter',
|
||||
providerIdentifierField: 'id_str',
|
||||
providerData: providerData
|
||||
};
|
||||
|
||||
// // Save the user OAuth profile
|
||||
// users.saveOAuthUserProfile(req, providerUserProfile, done);
|
||||
// }
|
||||
// ));
|
||||
// };
|
||||
// Save the user OAuth profile
|
||||
users.saveOAuthUserProfile(req, providerUserProfile, done);
|
||||
}
|
||||
));
|
||||
};
|
||||
|
|
|
@ -247,10 +247,13 @@ module.exports = function(grunt) {
|
|||
});
|
||||
|
||||
grunt.event.on('coverage', function(lcov, done){
|
||||
require('coveralls').handleInput(lcov, function(err){
|
||||
var coveralls = require('coveralls');
|
||||
coveralls.handleInput(lcov, function(err){
|
||||
if (err) {
|
||||
grunt.log.error("Failed to submit lcov file to coveralls: " + err);
|
||||
return done(err);
|
||||
}
|
||||
grunt.verbose.ok("Successfully submitted lcov file to coveralls");
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"start": "grunt",
|
||||
"test": "grunt test",
|
||||
"test": "grunt test && grunt coveralls",
|
||||
"postinstall": "bower install --config.interactive=false; grunt build"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
@ -55,12 +55,6 @@ body {
|
|||
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
|
||||
display: none !important;
|
||||
}
|
||||
.ng-invalid.ng-dirty {
|
||||
/*border-color: #FA787E;*/
|
||||
}
|
||||
.ng-valid.ng-dirty {
|
||||
/*border-color: #78FA89;*/
|
||||
}
|
||||
.browsehappy.jumbotron.hide,
|
||||
body.ng-cloak
|
||||
{
|
||||
|
@ -94,6 +88,7 @@ section.hero-section .jumbotron {
|
|||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: rgb(0,0,0);
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
z-index: -97;
|
||||
}
|
||||
|
@ -105,6 +100,4 @@ section.hero-section .jumbotron {
|
|||
padding: 0.3em 0.9em;
|
||||
color: white;
|
||||
}
|
||||
section.hero-section .jumbotron .signup-btn {
|
||||
background-color:rgba(250, 120, 126, 0.65) #FA787E;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
/* This is the native select, we're making everything but the text invisible so we can see the button styles in the wrapper */
|
||||
.custom-select select {
|
||||
width:100%;
|
||||
margin:0;
|
||||
margin:0px;
|
||||
background:none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 0px;
|
||||
|
@ -22,6 +22,7 @@
|
|||
/* Remove select styling */
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
/* Font size must the 16px or larger to prevent iOS page zoom on focus */
|
||||
font-size:1em;
|
||||
/* General select styles: change as needed */
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
.busy-submitting-wrapper {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
section.public-form {
|
||||
|
@ -61,9 +61,11 @@ section.content p.breakwords {
|
|||
background-position: right 8px center;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
outline: none;
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.075);
|
||||
}
|
||||
.modal-footer input[type='text']:focus {
|
||||
outline: none;
|
||||
}
|
||||
.modal-body > .modal-body-alert {
|
||||
color: #796620;
|
||||
background-color: #f8eec7;
|
||||
|
@ -106,7 +108,6 @@ form .row.field {
|
|||
form .row.field > .field-input {
|
||||
font-size: 1.4em;
|
||||
color: #777;
|
||||
/*width: inherit;*/
|
||||
}
|
||||
form.submission-form .row.field.statement > .field-title {
|
||||
font-size:1.7em;
|
||||
|
@ -121,6 +122,7 @@ form .row.field {
|
|||
}
|
||||
|
||||
form.submission-form .field.row.radio .btn.activeBtn {
|
||||
background-color: rgb(0,0,0)!important;
|
||||
background-color: rgba(0,0,0,0.7)!important;
|
||||
color: white;
|
||||
}
|
||||
|
@ -191,6 +193,7 @@ form .row.field {
|
|||
border: 1px solid #e3e3e3;
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
|
||||
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
|
||||
}
|
||||
|
||||
|
@ -216,12 +219,12 @@ div.config-form .row.field {
|
|||
|
||||
/* Styles for form admin view (/forms/:formID/admin) */
|
||||
.admin-form > .page-header {
|
||||
padding-bottom: 0px;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.admin-form > .page-header h1 {
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
.admin-form > .page-header > .col-xs-3 {
|
||||
padding-top: 1.4em;
|
||||
|
@ -283,11 +286,11 @@ div.config-form .row.field {
|
|||
.submissions-table .table-outer.row {
|
||||
margin-top: 1.5em;
|
||||
margin-bottom: 2em;
|
||||
margin-left: 0px!important;
|
||||
margin-right: 0px!important;
|
||||
margin-left: 0!important;
|
||||
margin-right: 0!important;
|
||||
}
|
||||
.submissions-table .table-outer .col-xs-12 {
|
||||
padding-left: 0px!important;
|
||||
padding-left: 0!important;
|
||||
border:1px solid #ddd;
|
||||
overflow-x: scroll;
|
||||
border-radius:3px;
|
||||
|
@ -402,10 +405,12 @@ section > section.public-form {
|
|||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: rgb(0,0,0);
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
z-index: 10;
|
||||
}
|
||||
.overlay.submitform {
|
||||
background-color: rgb(256,256,256);
|
||||
background-color: rgba(256,256,256,0.8);
|
||||
}
|
||||
.field-directive {
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
tmp_scope.user = sampleUser;
|
||||
|
||||
//gotacha: Controller and link functions will execute.
|
||||
el = angular.element('<configure-form-directive myform='myform' user='user'></configure-form-directive>');
|
||||
el = angular.element('<configure-form-directive myform=\'myform\' user=\'user\'></configure-form-directive>');
|
||||
$compile(el)(tmp_scope);
|
||||
$rootScope.$digest();
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
tmp_scope.user = sampleUser;
|
||||
|
||||
//gotacha: Controller and link functions will execute.
|
||||
el = angular.element('<edit-submissions-form-directive myform='myform' user='user'></edit-submissions-form-directive>');
|
||||
el = angular.element('<edit-submissions-form-directive myform=\'myform\' user=\'user\'></edit-submissions-form-directive>');
|
||||
$compile(el)(tmp_scope);
|
||||
$rootScope.$digest();
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
tmp_scope.myform = _.cloneDeep(sampleForm);
|
||||
|
||||
//gotacha: Controller and link functions will execute.
|
||||
el = angular.element('<edit-form-directive myform='myform'></edit-form-directive>');
|
||||
el = angular.element('<edit-form-directive myform=\'myform\'></edit-form-directive>');
|
||||
$compile(el)(tmp_scope);
|
||||
$rootScope.$digest();
|
||||
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
};
|
||||
|
||||
var pdfObj = {
|
||||
fieldname:"file",
|
||||
originalname:"test.pdf",
|
||||
name:"1440112660375.pdf",
|
||||
encoding:"7bit",
|
||||
mimetype:"application/pdf",
|
||||
path:"uploads/tmp/test@test.com/1440112660375.pdf",
|
||||
extension:"pdf",
|
||||
fieldname:'file',
|
||||
originalname:'test.pdf',
|
||||
name:'1440112660375.pdf',
|
||||
encoding:'7bit',
|
||||
mimetype:'application/pdf',
|
||||
path:'uploads/tmp/test@test.com/1440112660375.pdf',
|
||||
extension:'pdf',
|
||||
size:56223,
|
||||
truncated:false,
|
||||
buffer:null
|
||||
|
@ -131,7 +131,7 @@
|
|||
tmp_scope.myform = sampleForm;
|
||||
|
||||
//gotacha: Controller and link functions will execute.
|
||||
var el = angular.element('<submit-form-directive myform="myform"></submit-form-directive>');
|
||||
var el = angular.element('<submit-form-directive myform=\'myform\'></submit-form-directive>');
|
||||
$compile(el)(tmp_scope);
|
||||
tmp_scope.$digest();
|
||||
$rootScope.$digest();
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('stateMock',[]);
|
||||
angular.module('stateMock').service('$state', function($q){
|
||||
this.expectedTransitions = [];
|
||||
|
|
Loading…
Reference in a new issue