From 79610eaf3c0628c8b84da3a4bbf8a6598e1a03cb Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 13 Aug 2012 11:45:51 +0200 Subject: seperated session from the srp flow - login tests pass, signup fail --- spec/DjangoSpecRunner.html | 1 + spec/django/login.js | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'spec') 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 @@ + 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(); }); }); -- cgit v1.2.3