summaryrefslogtreecommitdiff
path: root/spec/session_spec.js
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2013-06-22 16:17:45 +0200
committerAzul <azul@riseup.net>2013-06-24 12:33:03 +0200
commit0c5369fd9299eb9bf7295e3925ce803c5473e2b8 (patch)
tree14a591408caecc369b84d985dae1864019f3aedc /spec/session_spec.js
parentf1ad0b7e428205a76f6176f44100eac39bb80310 (diff)
refactor: separate account from session
Diffstat (limited to 'spec/session_spec.js')
-rw-r--r--spec/session_spec.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/session_spec.js b/spec/session_spec.js
index 5802283..a1378a6 100644
--- a/spec/session_spec.js
+++ b/spec/session_spec.js
@@ -29,19 +29,19 @@ describe("Session", function() {
var session;
beforeEach(function() {
- session = new srp.Session(compare.username, compare.password);
+ account = new srp.Account(compare.username, compare.password);
+ session = new srp.Session(account);
});
- it("has the proper username", function() {
- expect(session.getI()).toBe(compare.username);
- });
-
- it("calculates the proper M", function() {
+ it("calculates the proper M (INTEGRATION)", function() {
session.calculateAndSetA(compare.a);
session.calculations(compare.salt, compare.bb);
expect(session.getS().toString(16)).toBe(compare.s);
- // failing from here on...
expect(session.key()).toBe(compare.k);
expect(session.getM()).toBe(compare.m);
});
+
+ it("delegates login", function() {
+ expect(session.login()).toBe(compare.username);
+ });
});