Skip to content

Commit

Permalink
Passing basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
griffobeid committed Nov 9, 2023
1 parent afbdd2a commit c69ca41
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
16 changes: 0 additions & 16 deletions actix-api/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,3 @@ pub fn dbmate_up(url: &str) {
}
}

pub fn dbmate_drop(url: &str) {
log::info!("dbmate drop DATABASE_URL: {}", url);
let do_steps = || -> bool {
Command::new("sh")
.arg("-c")
.arg("dbmate drop")
.env("DATABASE_URL", url)
.status()
.expect("failed to execute process")
.success()
};
if !do_steps() {
log::error!("Failed to perform dbmate drop operation");
}
}

8 changes: 1 addition & 7 deletions actix-api/tests/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,5 @@ async fn test_login() {
let req = test::TestRequest::get().uri("/login").to_request();
let resp = test::call_service(&mut app, req).await;
drop(app);
println!("{:?}", resp.status());
assert!(resp.status().is_success());
let body = test::read_body(resp).await;
let body = String::from_utf8(body.to_vec()).unwrap();
assert!(body.contains("https://accounts.google.com/o/oauth2/v2/auth"));
assert!(body.contains("code_challenge="));
assert!(body.contains("state="));
assert!(resp.status() == 302);
}
1 change: 1 addition & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ services:
- OAUTH_REDIRECT_URL=http://localhost:${ACTIX_PORT:-8080}/login/callback
- RUST_LOG=info
- PG_URL=postgres://postgres:docker@postgres:5432/actix-api-db?sslmode=disable
- DBMATE_MIGRATIONS_DIR=/app/dbmate/db/migrations
ports:
- "${ACTIX_PORT:-8080}:${ACTIX_PORT:-8080}"
volumes:
Expand Down

0 comments on commit c69ca41

Please sign in to comment.