Skip to content

Commit ee28e7b

Browse files
committed
2 parents 226ef66 + 841833f commit ee28e7b

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

app/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111
},
1212

1313
// MONGO_URL: process.env.MONGO_URL || 'mongodb://localhost:27017/fit-journal',
14-
MONGO_URL: process.env.MONGO_URL || 'mongodb://ds237932.mlab.com:37932/fit-journal',
14+
MONGO_URL: process.env.MONGO_URL || 'mongodb:admin:"W!nner05"//ds237932.mlab.com:37932/fit-journal',
1515
TEST_MONGO_URL: process.env.TEST_MONGO_URL || 'mongodb://localhost:27017/test-fit-journal',
1616
JWT_SECRET: process.env.JWT_SECRET || 'default',
1717
JWT_EXPIRY: process.env.JWT_EXPIRY || '7d',

app/workout/workout.model.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
const mongoose = require("mongoose");
22
const Joi = require("joi");
3+
<<<<<<< HEAD
4+
5+
6+
=======
7+
>>>>>>> dff35dff0e6fd194376bd54c2775744a4a60aa8b
38

49
const workoutSchema = new mongoose.Schema({
510
user: {

public/auth.page.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ function onSignUpSubmit(event) {
2525
},
2626
onError: err => {
2727
alert('There was a problem processing your request, please try again later.');
28+
2829
}
2930
});
3031
}

test/workout.test.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,25 @@ describe('Integration tests for: /api/home', function() {
107107
.get('/api/home')
108108
.set('Authorization', `Bearer ${jwtToken}`)
109109
.then(res => {
110+
<<<<<<< HEAD
111+
console.log("The body:",res.body[0].sets);
112+
=======
110113
console.log("The body:", res.body[0].sets);
114+
>>>>>>> dff35dff0e6fd194376bd54c2775744a4a60aa8b
111115
expect(res).to.have.status(HTTP_STATUS_CODES.OK);
112116
expect(res).to.be.json;
113117
expect(res.body).to.be.a('array');
114118
expect(res.body).to.have.lengthOf.at.least(1);
119+
<<<<<<< HEAD
120+
121+
const workout = res.body[0];
122+
console.log("User workout:", workout)
123+
124+
expect(workout).to.include.keys('user','sets');
125+
expect(workout.sets).to.include.keys( 'exercise', 'set', 'reps')
126+
expect(workout.user).to.be.a('string');
127+
128+
=======
115129

116130
const workout = res.body[0];
117131
console.log("User workout:", workout)
@@ -120,14 +134,19 @@ describe('Integration tests for: /api/home', function() {
120134
expect(workout.sets).to.include.keys('exercise', 'set', 'reps')
121135
expect(workout.user).to.be.a('string');
122136

137+
>>>>>>> dff35dff0e6fd194376bd54c2775744a4a60aa8b
123138
});
124139
});
125140

126141
it('Should return a specific workout', function() {
127142
let foundWorkout;
128143
return Workout.find()
129144
.then(workouts => {
145+
<<<<<<< HEAD
146+
147+
=======
130148

149+
>>>>>>> dff35dff0e6fd194376bd54c2775744a4a60aa8b
131150
expect(workouts).to.be.a('array');
132151
expect(workouts).to.have.lengthOf.at.least(1);
133152
foundWorkout = workouts[0];
@@ -137,11 +156,19 @@ describe('Integration tests for: /api/home', function() {
137156
.set('Authorization', `Bearer ${jwtToken}`);
138157
})
139158
.then(res => {
159+
<<<<<<< HEAD
160+
161+
expect(res).to.have.status(HTTP_STATUS_CODES.OK);
162+
expect(res).to.be.json;
163+
// expect(res.body).to.be.a('object');
164+
expect(res.body).to.include.keys('user','sets');
165+
=======
140166

141167
expect(res).to.have.status(HTTP_STATUS_CODES.OK);
142168
expect(res).to.be.json;
143169
// expect(res.body).to.be.a('object');
144170
expect(res.body).to.include.keys('user', 'sets');
171+
>>>>>>> dff35dff0e6fd194376bd54c2775744a4a60aa8b
145172
expect(res.body.sets).to.include.keys('exercise', 'set', 'reps');
146173

147174
});
@@ -181,6 +208,10 @@ describe('Integration tests for: /api/home', function() {
181208
}
182209

183210
function createFakerWorkout() {
211+
<<<<<<< HEAD
212+
return {sets:{exercise: faker.lorem.word(),set: faker.random.number(),reps: faker.random.number()}};
213+
=======
184214
return { sets: { exercise: faker.lorem.word(), set: faker.random.number(), reps: faker.random.number() } };
215+
>>>>>>> dff35dff0e6fd194376bd54c2775744a4a60aa8b
185216
}
186217
});

0 commit comments

Comments
 (0)