Merge branch 'develop' into api-v3

This commit is contained in:
Matteo Pagliazzi
2015-11-27 17:05:29 +01:00
56 changed files with 3747 additions and 3338 deletions
+28
View File
@@ -101,6 +101,34 @@ describe('user.fns.buy', () => {
expect(user.items.gear.equipped).to.not.have.property('armor');
});
it('removes one-handed weapon and shield if auto-equip is on and a two-hander is bought', () => {
user.stats.gp = 100;
user.preferences.autoEquip = true;
user.ops.buy({params: {key: 'shield_warrior_1'}});
user.ops.equip({params: {key: 'shield_warrior_1'}});
user.ops.buy({params: {key: 'weapon_warrior_1'}});
user.ops.equip({params: {key: 'weapon_warrior_1'}});
user.ops.buy({params: {key: 'weapon_wizard_1'}});
expect(user.items.gear.equipped).to.have.property('shield', 'shield_base_0');
expect(user.items.gear.equipped).to.have.property('weapon', 'weapon_wizard_1');
});
it('buys two-handed equipment but does not automatically remove sword or shield', () => {
user.stats.gp = 100;
user.preferences.autoEquip = false;
user.ops.buy({params: {key: 'shield_warrior_1'}});
user.ops.equip({params: {key: 'shield_warrior_1'}});
user.ops.buy({params: {key: 'weapon_warrior_1'}});
user.ops.equip({params: {key: 'weapon_warrior_1'}});
user.ops.buy({params: {key: 'weapon_wizard_1'}});
expect(user.items.gear.equipped).to.have.property('shield', 'shield_warrior_1');
expect(user.items.gear.equipped).to.have.property('weapon', 'weapon_warrior_1');
});
it('does not buy equipment without enough Gold', () => {
user.stats.gp = 20;