diff options
author | Azul <azul@riseup.net> | 2012-08-13 11:45:51 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2012-08-13 11:45:51 +0200 |
commit | 79610eaf3c0628c8b84da3a4bbf8a6598e1a03cb (patch) | |
tree | 412cf8475bbb1dd19e42f12e1ba6393beefe0e12 /spec | |
parent | da8f6025900740684bc81e9a7c22f6a83ed48d79 (diff) |
seperated session from the srp flow - login tests pass, signup fail
Diffstat (limited to 'spec')
-rw-r--r-- | spec/DjangoSpecRunner.html | 1 | ||||
-rw-r--r-- | spec/django/login.js | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/spec/DjangoSpecRunner.html b/spec/DjangoSpecRunner.html index 7a39dde..5d8c95a 100644 --- a/spec/DjangoSpecRunner.html +++ b/spec/DjangoSpecRunner.html @@ -21,6 +21,7 @@ <script type="text/javascript" src="../lib/jsbn2.js"></script> <script type="text/javascript" src="../lib/srp.js"></script> <script type="text/javascript" src="../lib/plainXHR.js"></script> + <script type="text/javascript" src="../lib/srp_session.js"></script> <script type="text/javascript" src="../lib/srp_register.js"></script> <!-- include spec files here... --> diff --git a/spec/django/login.js b/spec/django/login.js index eea6062..d13f695 100644 --- a/spec/django/login.js +++ b/spec/django/login.js @@ -16,8 +16,10 @@ describe("Login", function() { beforeEach(function() { - this.srp = new SRP(); - A = this.srp.calculateAndSetA(a); + var srp = new SRP(); + var session = new srp.Session(); + this.srp = new SRP(null, session) + A = session.calculateAndSetA(a); specHelper.setupFakeXHR.apply(this); @@ -51,14 +53,14 @@ describe("Login", function() { }); it("rejects B = 0", function(){ - this.srp.error_message = sinon.spy(); + this.srp.error = sinon.spy(); this.srp.identify(); this.expectRequest('handshake/', 'I=user&A='+A); this.respondJSON({s: salt, B: 0}); // aborting if B=0 expect(this.requests).toEqual([]); - expect(this.srp.error_message).toHaveBeenCalled(); + expect(this.srp.error).toHaveBeenCalled(); }); }); |