Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lessons/08-tests-tasks/twetter/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//Comment and section the parts in this file and look into using express router for api routes. Also, maybe utilize a separate authentication file for all things authentication related.
var express = require('express');
var path = require('path');
var logger = require('morgan');
Expand Down Expand Up @@ -64,7 +65,7 @@ passport.use(new FacebookStrategy({
}
));

passport.use(new LocalStrategy(
passport.use(new LocalStrategy( //good job on getting this working!!
function(username, password, done) {
User.findOne({ username: username }, function (err, user) {
if (err) { return done(err); }
Expand Down
12 changes: 12 additions & 0 deletions lessons/08-tests-tasks/twetter/feedback.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Homework Feedback:

Functionality:
- Completion: You have all of the functionalities (including tests and OAuth!); however, you don't have delete tweet working. Also, awesome tests. I appreciate that you sectioned them out and that they are detailed. There are two that don't pass for me: 'should return 200 OK on authenticated GET /' and 'should get user session for current user'. Both seem to be user specific, which might make sense because you're not setting a user session anywhere. (16/20)
- Bug Free: The app does seem bug free. Again, you don't have deleting tweets working. It's a good idea to remove your log statements when you are in production. (10/10)

Quality:
- Good Coding Practices: You use good styling practices, specifically the way you group your different jquery calls and reuse functions. The tests are written out nicely and follow the right syntax. (10/10)
- Readability: Functions and variables are named well, good comments and lines are not too long and sectioned well. (10/10)


Good work!!!!!!
1 change: 1 addition & 0 deletions lessons/08-tests-tasks/twetter/public/javascripts/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//You're missing a delete functionality for each of your tweets. Also, remove console logs that are specifc to just debugging. Good naming of the different functions and variables.
var $postForm = $("#twet-post-form");
var $loginForm = $("#login-form");
var $templateLi = $('#template-li');
Expand Down
2 changes: 2 additions & 0 deletions lessons/08-tests-tasks/twetter/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//I like that you comment on each post that you have, but it would be nice if you split this file into multiple files grouping them (user-specific, login-specific, tweets-specifc). I would also use express router to clean up and make api specific routes, but since we're doing some rendering from the backend, it's not as easy to do. Your local stategy is working though!!!!
var path = require('path');
var express = require('express');
var Twet = require('../models/twetModel.js');
Expand Down Expand Up @@ -46,6 +47,7 @@ routes.dashGET = function(req, res) {
if (req.user) {
User.findOne({username: req.user.username}, function (err, user) {
if (user) {
//Remove console logs that were just for your debugging, and comment the specifics of how you're using mongoose queries.
console.log(user);
res.locals.currentUser = user;
Twet.find().sort({_id: -1}).exec(function(err,twets) {
Expand Down