+Adding new tests for /members/me/nickname
* Fixed incorrect param key in endpoint handler +Adding a ycm conf for easier writing
This commit is contained in:
parent
5db976b9de
commit
93fd8c2cd6
4
json-api/client-tests/.ycm_extra_conf.py
Normal file
4
json-api/client-tests/.ycm_extra_conf.py
Normal file
@ -0,0 +1,4 @@
|
||||
def Settings(**kwargs):
|
||||
return {
|
||||
'interpreter_path': '/home/shockrah/GitRepos/freechat/json-api/client-tests/bin/python'
|
||||
}
|
@ -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:
|
||||
|
@ -56,7 +56,7 @@ pub async fn post_self_nickname(p: &Pool, response: &mut Response<Body>, 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 {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user