diff options
Diffstat (limited to 'spec/restful')
-rw-r--r-- | spec/restful/.login.js.swp | bin | 12288 -> 0 bytes | |||
-rw-r--r-- | spec/restful/.signup.js.swp | bin | 12288 -> 0 bytes | |||
-rw-r--r-- | spec/restful/signup.js | 37 |
3 files changed, 3 insertions, 34 deletions
diff --git a/spec/restful/.login.js.swp b/spec/restful/.login.js.swp Binary files differdeleted file mode 100644 index 7a6e842..0000000 --- a/spec/restful/.login.js.swp +++ /dev/null diff --git a/spec/restful/.signup.js.swp b/spec/restful/.signup.js.swp Binary files differdeleted file mode 100644 index 686174a..0000000 --- a/spec/restful/.signup.js.swp +++ /dev/null diff --git a/spec/restful/signup.js b/spec/restful/signup.js index 26e97b5..b1ed7e8 100644 --- a/spec/restful/signup.js +++ b/spec/restful/signup.js @@ -13,47 +13,16 @@ describe("Signup", function() { expect(typeof this.srp.register).toBe('function'); }); - it("fetches a salt from /register/salt", function(){ - var callback = sinon.spy(); - this.srp.register_receive_salt = callback; - this.srp.register(); - this.expectRequest('register/salt/', "I=user") - this.respondXML("<salt>5d3055e0acd3ddcfc15</salt>"); - expect(callback.called).toBeTruthy(); - }); - - it("receives the salt from /register/salt", function(){ - var callback = sinon.spy(); - this.srp.remote.register_send_verifier = callback; - this.srp.register(); - this.expectRequest('register/salt/', "I=user") - this.respondXML("<salt>5d3055e0acd3ddcfc15</salt>"); - expect(callback).toHaveBeenCalledWith("adcd57b4a4a05c2e205b0b7b30014d9ff635d8d8db2f502f08e9b9c132800c44", this.srp.registered_user); - }); - it("identifies after successful registration (INTEGRATION)", function(){ var callback = sinon.spy(); this.srp.identify = callback; + this.srp.getSalt = function() {return "5d3055e0acd3ddcfc15"}; this.srp.register(); - this.expectRequest('register/salt/', "I=user") - this.respondXML("<salt>5d3055e0acd3ddcfc15</salt>"); - this.expectRequest('register/user/', "v=adcd57b4a4a05c2e205b0b7b30014d9ff635d8d8db2f502f08e9b9c132800c44"); - this.respondXML("<ok />"); + this.expectRequest('users', "user[login]=user&user[password_salt]=5d3055e0acd3ddcfc15&user[password_verifier]=adcd57b4a4a05c2e205b0b7b30014d9ff635d8d8db2f502f08e9b9c132800c44") + this.respondJSON({password_salt: "5d3055e0acd3ddcfc15", login: "user", ok: "true"}); expect(callback).toHaveBeenCalled(); }); - it("identifies after successful registration with JSON (INTEGRATION)", function(){ - var callback = sinon.spy(); - this.srp.identify = callback; - this.srp.register(); - this.expectRequest('register/salt/', "I=user") - this.respondJSON({salt: "5d3055e0acd3ddcfc15"}); - this.expectRequest('register/user/', "v=adcd57b4a4a05c2e205b0b7b30014d9ff635d8d8db2f502f08e9b9c132800c44"); - this.respondJSON({ok: true}); - expect(callback).toHaveBeenCalled(); - }); - - }); |