Added stack splitting and merging to inventory

This commit is contained in:
Thaum
2015-03-25 12:09:24 +00:00
parent 6b14b820a6
commit cb2d1ab958
6 changed files with 124 additions and 20 deletions

View File

@@ -3,32 +3,23 @@ if (!(typeof MochaWeb === 'undefined')){
var charId;
describe("Character", function(){
describe("insert", function(){
it("should create a character", function(done){
Characters.insert({owner: "FWeGYyDY5jc4HuTh8"}, function(err, id){
charId = id;
done(err);
});
it("should create a character", function(){
charId = Characters.insert({owner: "FWeGYyDY5jc4HuTh8"});
});
});
});
describe("attribute.adjustment", function(){
Characters.insert({owner: "FWeGYyDY5jc4HuTh8"}, function(err, id){
charId = id;
done(err);
});
Characters.insert({owner: "FWeGYyDY5jc4HuTh8"});
it("should track attribute adjustments", function(){
Characters.update(charId, {$set: {"strength.adjustment": -12}},{},function(err, num){
console.log(num);
done(err);
});
Characters.update(charId, {$set: {"strength.adjustment": -12}});
});
it("should report the adjusted attribute correctly", function(){
var val = Characters.findOne(charId).attributeValue("strength");
chai.assert.equal(val, -12);
val = 0;
val = Characters.findOne(charId).fieldValue("strength");
chai.assert.equal(val, -12);
});
});
Characters.remove({});
});
});
}