[API v3] Fix calls to user.ops and deleting tags (#7204)

* v3: fixes calls to user.ops from views and deleting tags

* v3: fix tests that use user._statsComputed
This commit is contained in:
Matteo Pagliazzi
2016-05-13 19:45:16 +02:00
parent 468a312357
commit cc20812674
18 changed files with 78 additions and 24 deletions
+9 -3
View File
@@ -76,7 +76,11 @@ describe('Stats Service', function() {
"armor" : "armor_warrior_1"
};
var user = {
_statsComputed: { str: 50 },
fns: {
statsComputed: function () {
return { str: 50 };
},
},
stats: {
lvl: 10,
buffs: { str: 10 },
@@ -252,7 +256,8 @@ describe('Stats Service', function() {
describe('mpDisplay', function() {
it('displays mp as "mp / totalMP"', function() {
user._statsComputed = { maxMP: 100 };
user.fns = {};
user.fns.statsComputed = function () { return { maxMP: 100 } };
user.stats.mp = 30;
var mpDisplay = statCalc.mpDisplay(user);
@@ -260,7 +265,8 @@ describe('Stats Service', function() {
});
it('Rounds mp down when given a decimal', function() {
user._statsComputed = { maxMP: 100 };
user.fns = {};
user.fns.statsComputed = function () { return { maxMP: 100 } };
user.stats.mp = 30.99;
var mpDisplay = statCalc.mpDisplay(user);