Use a fake database in tests

This commit is contained in:
Antonio Scandurra 2022-02-17 17:04:04 +01:00
parent 0b46e36189
commit 19b4ecd33a
5 changed files with 669 additions and 369 deletions

View file

@ -111,7 +111,7 @@ async fn create_access_token(request: Request) -> tide::Result {
.get_user_by_github_login(request.param("github_login")?)
.await?
.ok_or_else(|| surf::Error::from_str(StatusCode::NotFound, "user not found"))?;
let access_token = auth::create_access_token(request.db(), user.id).await?;
let access_token = auth::create_access_token(request.db().as_ref(), user.id).await?;
#[derive(Deserialize)]
struct QueryParams {