Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

Commit

Permalink
feat(users): add default image to user model
Browse files Browse the repository at this point in the history
  • Loading branch information
Andela-Jalil committed Dec 17, 2018
1 parent 742614d commit 7d947f9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
3 changes: 2 additions & 1 deletion server/migrations/20181029191911-create-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export default {
},
avatarUrl: {
allowNull: true,
type: Sequelize.STRING
type: Sequelize.STRING,
defaultValue: 'https://bit.ly/2UT01ax',
},
facebookId: {
allowNull: true,
Expand Down
1 change: 1 addition & 0 deletions server/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default (sequelize, DataTypes) => {
avatarUrl: {
allowNull: true,
type: DataTypes.STRING,
defaultValue: 'https://bit.ly/2UT01ax',
},
facebookId: {
allowNull: true,
Expand Down
4 changes: 0 additions & 4 deletions test/server/controllers/ArticleController.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ describe('Articles Controller Tests', () => {
should.equal(res.body.articles[0]
.description, 'Team valinor is a simulation team');
should.equal(res.body.articles[0].author.fullName, 'John Mike');
should.equal(res.body.articles[0].author.avatarUrl, null);
should.equal(res.status, 200);
done();
});
Expand Down Expand Up @@ -138,7 +137,6 @@ describe('Articles Controller Tests', () => {
should.equal(res.body.articles[0]
.description, 'Team valinor is a simulation team');
should.equal(res.body.articles[0].author.fullName, 'John Mike');
should.equal(res.body.articles[0].author.avatarUrl, null);
should.equal(res.status, 200);
done();
});
Expand Down Expand Up @@ -329,7 +327,6 @@ describe('Articles Controller Tests', () => {
.eql('johnmike@andela.com');
res.body.article.author.fullName.should.be
.eql('John Mike');
should.equal(res.body.article.author.avatarUrl, null);
done();
});
});
Expand All @@ -349,7 +346,6 @@ describe('Articles Controller Tests', () => {
.eql('johnmike@andela.com');
res.body.article.author.fullName.should.be
.eql('John Mike');
should.equal(res.body.article.author.avatarUrl, null);
done();
});
});
Expand Down
1 change: 0 additions & 1 deletion test/server/controllers/FollowController.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ describe('FollowController Tests', () => {
res.body.status.should.be.eql('success');
res.body.following.length.should.be.eql(0);
res.body.followers[0].fullName.should.be.eql('Fishes Donkey');
should.equal(res.body.followers[0].avatarUrl, null);
done();
});
});
Expand Down

0 comments on commit 7d947f9

Please sign in to comment.