From 7791caac4f3dc8f9b2fcca394ad9ce0cd12b6996 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 2 Oct 2012 14:29:20 +0200 Subject: fixed restful signup test --- spec/restful/signup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/restful/signup.js') diff --git a/spec/restful/signup.js b/spec/restful/signup.js index b1ed7e8..e214508 100644 --- a/spec/restful/signup.js +++ b/spec/restful/signup.js @@ -16,7 +16,7 @@ describe("Signup", function() { it("identifies after successful registration (INTEGRATION)", function(){ var callback = sinon.spy(); this.srp.identify = callback; - this.srp.getSalt = function() {return "5d3055e0acd3ddcfc15"}; + this.srp.session.getSalt = function() {return "5d3055e0acd3ddcfc15"}; this.srp.register(); this.expectRequest('users', "user[login]=user&user[password_salt]=5d3055e0acd3ddcfc15&user[password_verifier]=adcd57b4a4a05c2e205b0b7b30014d9ff635d8d8db2f502f08e9b9c132800c44") this.respondJSON({password_salt: "5d3055e0acd3ddcfc15", login: "user", ok: "true"}); -- cgit v1.2.3 From 1c0454cbb1c0b8d75a3c192ff588365ef8bc19d0 Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 12 Oct 2012 18:52:53 +0200 Subject: got signup to work in accordance with py srp --- spec/restful/signup.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'spec/restful/signup.js') diff --git a/spec/restful/signup.js b/spec/restful/signup.js index e214508..bc20b14 100644 --- a/spec/restful/signup.js +++ b/spec/restful/signup.js @@ -13,13 +13,17 @@ describe("Signup", function() { expect(typeof this.srp.register).toBe('function'); }); + it("calculates the right x", function(){ + expect(this.srp.session.calcX("7686acb8").toString(16)).toBe('84d6bb567ddf584b1d8c8728289644d45dbfbb02deedd05c0f64db96740f0398'); + }); + it("identifies after successful registration (INTEGRATION)", function(){ var callback = sinon.spy(); this.srp.identify = callback; - this.srp.session.getSalt = function() {return "5d3055e0acd3ddcfc15"}; + this.srp.session.getSalt = function() {return "4c78c3f8"}; this.srp.register(); - this.expectRequest('users', "user[login]=user&user[password_salt]=5d3055e0acd3ddcfc15&user[password_verifier]=adcd57b4a4a05c2e205b0b7b30014d9ff635d8d8db2f502f08e9b9c132800c44") - this.respondJSON({password_salt: "5d3055e0acd3ddcfc15", login: "user", ok: "true"}); + this.expectRequest('users', "user[login]=testuser&user[password_salt]=4c78c3f8&user[password_verifier]=474c26aa42d11f20544a00f7bf9711c4b5cf7aab95ed448df82b95521b96668e7480b16efce81c861870302560ddf6604c67df54f1d04b99d5bb9d0f02c6051ada5dc9d594f0d4314e12f876cfca3dcd99fc9c98c2e6a5e04298b11061fb8549a22cde0564e91514080df79bca1c38c682214d65d590f66b3719f954b078b83c") + this.respondJSON({password_salt: "4c78c3f8", login: "testuser", ok: "true"}); expect(callback).toHaveBeenCalled(); }); -- cgit v1.2.3 From 09a6d9eb8d0467f311bbae3d6fe2d923244edb21 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 15 Oct 2012 11:10:35 +0200 Subject: all rest tests passing, using proper verbs --- spec/restful/signup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/restful/signup.js') diff --git a/spec/restful/signup.js b/spec/restful/signup.js index bc20b14..7b66dd7 100644 --- a/spec/restful/signup.js +++ b/spec/restful/signup.js @@ -22,7 +22,7 @@ describe("Signup", function() { this.srp.identify = callback; this.srp.session.getSalt = function() {return "4c78c3f8"}; this.srp.register(); - this.expectRequest('users', "user[login]=testuser&user[password_salt]=4c78c3f8&user[password_verifier]=474c26aa42d11f20544a00f7bf9711c4b5cf7aab95ed448df82b95521b96668e7480b16efce81c861870302560ddf6604c67df54f1d04b99d5bb9d0f02c6051ada5dc9d594f0d4314e12f876cfca3dcd99fc9c98c2e6a5e04298b11061fb8549a22cde0564e91514080df79bca1c38c682214d65d590f66b3719f954b078b83c") + this.expectRequest('users', "user[login]=testuser&user[password_salt]=4c78c3f8&user[password_verifier]=474c26aa42d11f20544a00f7bf9711c4b5cf7aab95ed448df82b95521b96668e7480b16efce81c861870302560ddf6604c67df54f1d04b99d5bb9d0f02c6051ada5dc9d594f0d4314e12f876cfca3dcd99fc9c98c2e6a5e04298b11061fb8549a22cde0564e91514080df79bca1c38c682214d65d590f66b3719f954b078b83c", 'POST') this.respondJSON({password_salt: "4c78c3f8", login: "testuser", ok: "true"}); expect(callback).toHaveBeenCalled(); }); -- cgit v1.2.3