Skip to content

Commit b896dc7

Browse files
committed
Add test for signing of boolean parameters
See #115.
1 parent c4ed527 commit b896dc7

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

codebird.es7.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@
10231023
* Generates the UNIX timestamp
10241024
*/
10251025
_time() {
1026-
Math.round(new Date().getTime() / 1000);
1026+
return Math.round(new Date().getTime() / 1000);
10271027
}
10281028

10291029
/**

codebird.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
994994
}, {
995995
key: "_time",
996996
value: function _time() {
997-
Math.round(new Date().getTime() / 1000);
997+
return Math.round(new Date().getTime() / 1000);
998998
}
999999

10001000
/**

test/functional_tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ test("Tests statuses/update", function (t) {
2727
},
2828
reply: {
2929
errors: [
30-
{ code: 215, message: "Bad Authentication data." }
30+
{ code: 89, message: "Invalid or expired token." }
3131
],
32-
httpstatus: 400
32+
httpstatus: 401
3333
}
3434
}
3535
)

test/oauth_tests.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,14 @@ test("Tests oauth2_token", function (t) {
9292
);
9393
});
9494
});
95+
96+
test("Tests signing of boolean parameters", function (t) {
97+
const cb = getCB();
98+
99+
t.equal(
100+
cb.call("_getSignature", ["GET", "friends/ids", ["stringify_ids"], [true]]),
101+
"OFNuMTEnE82pfI0cAdJPgtO4xzY="
102+
);
103+
104+
t.end();
105+
});

0 commit comments

Comments
 (0)