summaryrefslogtreecommitdiff
path: root/users/test/integration/api/Readme.md
blob: 04363bdf834369c87d063dd0274bfa948bb10239 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
API tests
==========


Testing the restful api from a simple python client as that's what we'll be using.

This test so far mostly demoes the API. We have no SRP calc in there.

TODO: keep track of the cookies during login. The server uses the session to keep track of the random numbers A and B.

The output of signup_and_login_wrong_password pretty well describes the SRP API:

```
POST: http://localhost:9292/users.json
    {"user[password_salt]": "54321", "user[password_verifier]": "12345", "user[login]": "SWQ055"}
 -> {"password_salt":"54321","login":"SWQ055"}
POST: http://localhost:9292/sessions
    {"A": "12345", "login": "SWQ055"}
 -> {"B":"1778367531e93a4c7713c76f67649f35a4211ebc520926ae8c3848cd66171651"}
PUT: http://localhost:9292/sessions/SWQ055
    {"M": "123ABC"}
 -> {"errors":[{"login":"Not a valid username/password combination"},{"password":"Not a valid username/password combination"}]}
```