diff options
Diffstat (limited to 'javascript/spec')
-rw-r--r-- | javascript/spec/login.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/javascript/spec/login.js b/javascript/spec/login.js index 55cfa16..ea86584 100644 --- a/javascript/spec/login.js +++ b/javascript/spec/login.js @@ -5,7 +5,7 @@ describe("Login", function() { expect(typeof srp.identify).toBe('function'); }); - describe("Successfull Login (INTEGRATION)", function (){ + describe("(INTEGRATION)", function (){ // a valid auth attempt for the user / password given in the spec runner: var a = 'af141ae6'; var B = '887005895b1f5528b4e4dfdce914f73e763b96d3c901d2f41d8b8cd26255a75'; @@ -51,6 +51,17 @@ describe("Login", function() { expect(this.srp.success).toHaveBeenCalled(); expect(window.location.hash).toBe("#logged_in") }); + + it("rejects B = 0", function(){ + this.srp.error_message = 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(); + }); }); |