mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-02-23 14:59:07 +08:00
Remove API of signing
This commit is contained in:
parent
a7ac10bc8c
commit
2a5ba76b07
@ -8,7 +8,6 @@ Route::prefix('auth')->group(function () {
|
||||
|
||||
Route::prefix('user')->middleware('auth:jwt,oauth')->group(function () {
|
||||
Route::get('', 'UserController@user');
|
||||
Route::put('sign', 'UserController@sign');
|
||||
});
|
||||
|
||||
Route::prefix('players')->middleware('auth:jwt,oauth')->group(function () {
|
||||
|
@ -44,29 +44,3 @@ fn fetch_user_info() {
|
||||
assert_eq!(user.avatar, 0);
|
||||
assert_eq!(user.score, 1000);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sign() {
|
||||
let client = reqwest::Client::new();
|
||||
let body = client
|
||||
.put("http://127.0.0.1:32123/api/user/sign")
|
||||
.header("Authorization", login())
|
||||
.send()
|
||||
.unwrap()
|
||||
.json::<JsonBody<SignResult>>()
|
||||
.unwrap();
|
||||
assert!(body.is_success());
|
||||
|
||||
let sign_result = body.data().unwrap();
|
||||
assert!(sign_result.score > 1000);
|
||||
assert!(sign_result.remaining_time > 0);
|
||||
|
||||
let body = client
|
||||
.put("http://127.0.0.1:32123/api/user/sign")
|
||||
.header("Authorization", login())
|
||||
.send()
|
||||
.unwrap()
|
||||
.json::<JsonBody<SignResult>>()
|
||||
.unwrap();
|
||||
assert!(!body.is_success());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user