diff --git a/json-api/client-tests/.ycm_extra_conf.py b/json-api/client-tests/.ycm_extra_conf.py new file mode 100644 index 0000000..8681c0d --- /dev/null +++ b/json-api/client-tests/.ycm_extra_conf.py @@ -0,0 +1,4 @@ +def Settings(**kwargs): + return { + 'interpreter_path': '/home/shockrah/GitRepos/freechat/json-api/client-tests/bin/python' + } diff --git a/json-api/client-tests/client.py b/json-api/client-tests/client.py index f57f08e..ef9e54f 100644 --- a/json-api/client-tests/client.py +++ b/json-api/client-tests/client.py @@ -212,9 +212,10 @@ def run(worker: Worker): member_tests = [ - { 'init': ['get', '/members/me', {}], 'auth': jwt, 'hope': 200 }, - { 'init': ['get', '/members/me', {'asdf': 123}], 'auth': jwt, 'hope': 200 }, + { 'init': ['get', '/members/me', {}], 'auth': jwt, 'hope': 200, 'body': True}, { 'init': ['get', '/members/get_online', {}], 'auth': jwt, 'hope': 200, 'body': True}, + { 'init': ['post', '/members/me/nickname', {'nick': f'New name: {time.ctime()}'}], 'auth': jwt, 'hope': 200 }, + { 'init': ['get', '/members/me', {}], 'auth': jwt, 'hope': 200, 'body': True}, ] for test in member_tests: diff --git a/json-api/src/members.rs b/json-api/src/members.rs index 6e425b2..6761f51 100644 --- a/json-api/src/members.rs +++ b/json-api/src/members.rs @@ -56,7 +56,7 @@ pub async fn post_self_nickname(p: &Pool, response: &mut Response, params: * Assuming we have good input */ - let nick = qs_param!(params, "nicK", String); + let nick = qs_param!(params, "nick", String); *response.status_mut() = if let Some(nick) = nick {