Started fixing tests

master
Keith Irwin 2017-11-09 11:12:21 -05:00
parent af00aab0d1
commit 706e340c47
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
1 changed files with 54 additions and 55 deletions

109
test.js
View File

@ -5,146 +5,145 @@ const chai = require('chai'),
chai.use(chaiHttp);
describe('Public', function() {
describe('Public Pages', () => {
it('Displays homepage', function(done){
request(server).get('/')
function getPublicPage(url,done){
request(server.get(url)
.expect(200)
.end(function(err,res){ done(); });
});
.end( (err,res)=>{ done(); } )
}
it('Displays help page', function(done){
request(server).get('/help')
.expect(200)
.end(function(err,res){ done(); });
});
it('Displays homepage', (done) => {
getPublicPage ('/', done)
})
it('Displays terms of service', function(done){
request(server).get('/terms')
.expect(200)
.end(function(err,res){ done(); });
});
it('Displays help page', (done) => {
getPublicPage('/help',done)
})
it('Displays privacy policy', function(done){
request(server).get('/privacy')
.expect(200)
.end(function(err,res){ done(); });
});
it('Displays terms of service', (done) => {
getPublicPage ('/terms',done)
})
it('Displays robots.txt', function(done){
it('Displays privacy policy', (done) => {
getPublicPage ('/privacy', done)
it('Displays robots.txt', done) => {
request(server).get('/robots.txt')
.expect(200)
.expect('Content-Type', /text/)
.end(function(err,res){ done(); });
});
.end( (err,res) => { done(); } )
})
it('Displays demo map', function(done){
request(server).get('/map/keith')
.expect(200)
.end(function(err,res){ done(); });
});
it('Displays demo map', (done) => {
getPublicPage ('/demo', done)
})
});
it('Displays help page', (done) => {
getPublicPage ('/help', done)
})
})
describe('User', function() {
describe('User', () => {
it('Creates an account', function(done){
it('Creates an account', (done) => {
request(server).post('/signup',{"email":"test@tracman.org"})
.expect(200)
.end(function(err,res){ done(); });
.end( (err,res) => { done(); } );
});
//TODO: it('Creates a password', function(done){
//TODO: it('Creates a password', (done) => {
// });
//TODO: it('Logs in', function(done){
//TODO: it('Logs in', (done) => {
// });
//TODO: it('Logs out', function(done){
//TODO: it('Logs out', (done) => {
// });
//TODO: it('Forgets password', function(done){
//TODO: it('Forgets password', (done) => {
// });
//TODO: it('Changes forgotten password', function(done){
//TODO: it('Changes forgotten password', (done) => {
// });
//TODO: it('Logs back in', function(done){
//TODO: it('Logs back in', (done) => {
// });
//TODO: it('Changes email address', function(done){
//TODO: it('Changes email address', (done) => {
// });
//TODO: it('Changes password', function(done){
//TODO: it('Changes password', (done) => {
// });
//TODO: it('Changes settings', function(done){
//TODO: it('Changes settings', (done) => {
// });
//TODO: it('Connects a Google account', function(done){
//TODO: it('Connects a Google account', (done) => {
// });
//TODO: it('Connects a Facebook account', function(done){
//TODO: it('Connects a Facebook account', (done) => {
// });
//TODO: it('Connects a Twitter account', function(done){
//TODO: it('Connects a Twitter account', (done) => {
// });
//TODO: it('Logs in with Google', function(done){
//TODO: it('Logs in with Google', (done) => {
// });
//TODO: it('Logs in with Facebook', function(done){
//TODO: it('Logs in with Facebook', (done) => {
// });
//TODO: it('Logs in with Twitter', function(done){
//TODO: it('Logs in with Twitter', (done) => {
// });
//TODO: it('Disconnects a Google account', function(done){
//TODO: it('Disconnects a Google account', (done) => {
// });
//TODO: it('Disconnects a Facebook account', function(done){
//TODO: it('Disconnects a Facebook account', (done) => {
// });
//TODO: it('Disconnects a Twitter account', function(done){
//TODO: it('Disconnects a Twitter account', (done) => {
// });
//TODO: it('Shows own map', function(done){
//TODO: it('Shows own map', (done) => {
// request(server).get('/map')
// .expect(200)
// .end(function(err,res){ done(); });
// });
//TODO: it('Sets own location', function(done){
//TODO: it('Sets own location', (done) => {
// });
//TODO: it('Tracks own location', function(done){
//TODO: it('Tracks own location', (done) => {
// });
//TODO: it('Clears own location', function(done){
//TODO: it('Clears own location', (done) => {
// });
//TODO: it('Deletes account', function(done){
//TODO: it('Deletes account', (done) => {
// });