Minor style changes to inventoryCtrlSpec.js

This commit is contained in:
Dušan Juretić
2014-01-04 17:32:30 -03:00
parent a4c7775d51
commit a74e99a78f

View File

@@ -9,7 +9,7 @@ describe('Inventory Controller', function() {
user: { user: {
balance: 4, balance: 4,
stats: {gp: 0}, stats: {gp: 0},
items: {eggs: {'Cactus': 1}, hatchingPotions: {'Base': 1}, food: {'Meat': 1}, pets: {}}, items: {eggs: {Cactus: 1}, hatchingPotions: {Base: 1}, food: {Meat: 1}, pets: {}},
} }
}; };
window.habitrpgShared.wrap(user.user); window.habitrpgShared.wrap(user.user);
@@ -42,8 +42,8 @@ describe('Inventory Controller', function() {
it('hatches a pet', function(){ it('hatches a pet', function(){
scope.chooseEgg('Cactus'); scope.chooseEgg('Cactus');
scope.choosePotion('Base'); scope.choosePotion('Base');
expect(user.user.items.eggs).to.eql({'Cactus': 0}); expect(user.user.items.eggs).to.eql({Cactus: 0});
expect(user.user.items.hatchingPotions).to.eql({'Base': 0}); expect(user.user.items.hatchingPotions).to.eql({Base: 0});
expect(user.user.items.pets).to.eql({'Cactus-Base': 5}); expect(user.user.items.pets).to.eql({'Cactus-Base': 5});
expect(scope.selectedEgg).to.eql(null); expect(scope.selectedEgg).to.eql(null);
expect(scope.selectedPotion).to.eql(null); expect(scope.selectedPotion).to.eql(null);
@@ -52,21 +52,21 @@ describe('Inventory Controller', function() {
it('sells an egg', function(){ it('sells an egg', function(){
scope.chooseEgg('Cactus'); scope.chooseEgg('Cactus');
scope.sellInventory(); scope.sellInventory();
expect(user.user.items.eggs).to.eql({'Cactus': 0}); expect(user.user.items.eggs).to.eql({Cactus: 0});
expect(user.user.stats.gp).to.eql(3); expect(user.user.stats.gp).to.eql(3);
}); });
it('sells a potion', function(){ it('sells a potion', function(){
scope.choosePotion('Base'); scope.choosePotion('Base');
scope.sellInventory(); scope.sellInventory();
expect(user.user.items.hatchingPotions).to.eql({'Base': 0}); expect(user.user.items.hatchingPotions).to.eql({Base: 0});
expect(user.user.stats.gp).to.eql(2); expect(user.user.stats.gp).to.eql(2);
}); });
it('sells food', function(){ it('sells food', function(){
scope.chooseFood('Meat'); scope.chooseFood('Meat');
scope.sellInventory(); scope.sellInventory();
expect(user.user.items.food).to.eql({'Meat': 0}); expect(user.user.items.food).to.eql({Meat: 0});
expect(user.user.stats.gp).to.eql(1); expect(user.user.stats.gp).to.eql(1);
}); });