mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-29 23:52:50 +00:00
Extend profile model with gatherMusic
This commit is contained in:
parent
6c3f56cb26
commit
2814eabf72
3 changed files with 7 additions and 4 deletions
|
@ -15,7 +15,8 @@ var profileSchema = new Schema({
|
|||
},
|
||||
enslo: { type: Number, default: null },
|
||||
division: { type: String, default: null },
|
||||
skill: { type: String, default: null }
|
||||
skill: { type: String, default: null },
|
||||
gatherMusic: { type: String, default: null }
|
||||
});
|
||||
|
||||
profileSchema.path('userId').index({ unique: true });
|
||||
|
|
|
@ -53,7 +53,7 @@ User.prototype.getHiveId = () => {
|
|||
return index === 1 ? (tailId * 2) + 1 : tailId * 2;
|
||||
};
|
||||
|
||||
var allowedAttributes = ["enslo", "division", "skill"];
|
||||
var allowedAttributes = ["enslo", "division", "skill", "gatherMusic"];
|
||||
var allowedAbilities = ["skulk", "lerk", "fade", "gorge", "onos", "commander"];
|
||||
User.prototype.updateProfile = (data, callback) => {
|
||||
let self = this;
|
||||
|
|
|
@ -68,13 +68,15 @@ describe("User", () => {
|
|||
var attrs = {
|
||||
enslo: 88,
|
||||
division: "Foo",
|
||||
skill: "Bar"
|
||||
skill: "Bar",
|
||||
gatherMusic: "Baz"
|
||||
};
|
||||
user.updateProfile(attrs, (error, profile) => {
|
||||
if (error) return done(error);
|
||||
assert.equal(profile.enslo, attrs.enslo);
|
||||
assert.equal(profile.division, attrs.division);
|
||||
assert.equal(profile.foo, attrs.foo);
|
||||
assert.equal(profile.skill, attrs.skill);
|
||||
assert.equal(profile.gatherMusic, attrs.gatherMusic);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue