summaryrefslogtreecommitdiff
path: root/javascript/spec/login.js
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-07-20 10:56:36 +0200
committerAzul <azul@leap.se>2012-07-20 10:56:36 +0200
commit50de80c5e817476ac95a096c718a66f5555fcd05 (patch)
treee05a25868a999557e2788a91f41da3a5a8a1a0b0 /javascript/spec/login.js
parent07fe2d8976db0ec267bd57ded90778f0d7695478 (diff)
INCOMPATIBLE: major restructuring of the repository
* removed Django code - we're keeping the tests - so I hope the two can still be used together * removed js packer - everyone has their own packaging strategy these days * cleaned up the repository - we only have js so javascript directory does not make much sense
Diffstat (limited to 'javascript/spec/login.js')
-rw-r--r--javascript/spec/login.js69
1 files changed, 0 insertions, 69 deletions
diff --git a/javascript/spec/login.js b/javascript/spec/login.js
deleted file mode 100644
index ea86584..0000000
--- a/javascript/spec/login.js
+++ /dev/null
@@ -1,69 +0,0 @@
-describe("Login", function() {
-
- it("has an identify function", function() {
- var srp = new SRP();
- expect(typeof srp.identify).toBe('function');
- });
-
- describe("(INTEGRATION)", function (){
- // a valid auth attempt for the user / password given in the spec runner:
- var a = 'af141ae6';
- var B = '887005895b1f5528b4e4dfdce914f73e763b96d3c901d2f41d8b8cd26255a75';
- var salt = '5d3055e0acd3ddcfc15';
- var M = 'be6d7db2186d5f6a2c55788479b6eaf75229a7ca0d9e7dc1f886f1970a0e8065'
- var M2 = '2547cf26318519090f506ab73a68995a2626b1c948e6f603ef9e1b0b78bf0f7b';
- var A, callback;
-
-
- beforeEach(function() {
- this.srp = new SRP();
- A = this.srp.calculateAndSetA(a);
-
- specHelper.setupFakeXHR.apply(this);
-
- this.srp.success = sinon.spy();
- });
-
- afterEach(function() {
- this.xhr.restore();
- });
-
- it("works with XML responses", function(){
- this.srp.identify();
-
- this.expectRequest('handshake/', 'I=user&A='+A);
- this.respondXML("<r s='"+salt+"' B='"+B+"' />");
- this.expectRequest('authenticate/', 'M='+M);
- this.respondXML("<M>"+M2+"</M>");
-
- expect(this.srp.success).toHaveBeenCalled();
- expect(window.location.hash).toBe("#logged_in")
- });
-
- it("works with JSON responses", function(){
- this.srp.identify();
-
- this.expectRequest('handshake/', 'I=user&A='+A);
- this.respondJSON({s: salt, B: B});
- this.expectRequest('authenticate/', 'M='+M);
- this.respondJSON({M: M2});
-
- 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();
- });
- });
-
-
-});
-