Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
refactor: Split-up pgqueueerror into multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias committed Feb 6, 2024
1 parent ec370bc commit 46d3102
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 118 deletions.
4 changes: 1 addition & 3 deletions hook-api/src/handlers/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ mod tests {

#[sqlx::test(migrations = "../migrations")]
async fn index(db: PgPool) {
let pg_queue = PgQueue::new_from_pool("test_index", db)
.await
.expect("failed to construct pg_queue");
let pg_queue = PgQueue::new_from_pool("test_index", db).await;

let app = add_routes(Router::new(), pg_queue);

Expand Down
20 changes: 5 additions & 15 deletions hook-api/src/handlers/webhook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ mod tests {

#[sqlx::test(migrations = "../migrations")]
async fn webhook_success(db: PgPool) {
let pg_queue = PgQueue::new_from_pool("test_index", db)
.await
.expect("failed to construct pg_queue");
let pg_queue = PgQueue::new_from_pool("test_index", db).await;

let app = add_routes(Router::new(), pg_queue);

Expand Down Expand Up @@ -171,9 +169,7 @@ mod tests {

#[sqlx::test(migrations = "../migrations")]
async fn webhook_bad_url(db: PgPool) {
let pg_queue = PgQueue::new_from_pool("test_index", db)
.await
.expect("failed to construct pg_queue");
let pg_queue = PgQueue::new_from_pool("test_index", db).await;

let app = add_routes(Router::new(), pg_queue);

Expand Down Expand Up @@ -210,9 +206,7 @@ mod tests {

#[sqlx::test(migrations = "../migrations")]
async fn webhook_payload_missing_fields(db: PgPool) {
let pg_queue = PgQueue::new_from_pool("test_index", db)
.await
.expect("failed to construct pg_queue");
let pg_queue = PgQueue::new_from_pool("test_index", db).await;

let app = add_routes(Router::new(), pg_queue);

Expand All @@ -233,9 +227,7 @@ mod tests {

#[sqlx::test(migrations = "../migrations")]
async fn webhook_payload_not_json(db: PgPool) {
let pg_queue = PgQueue::new_from_pool("test_index", db)
.await
.expect("failed to construct pg_queue");
let pg_queue = PgQueue::new_from_pool("test_index", db).await;

let app = add_routes(Router::new(), pg_queue);

Expand All @@ -256,9 +248,7 @@ mod tests {

#[sqlx::test(migrations = "../migrations")]
async fn webhook_payload_body_too_large(db: PgPool) {
let pg_queue = PgQueue::new_from_pool("test_index", db)
.await
.expect("failed to construct pg_queue");
let pg_queue = PgQueue::new_from_pool("test_index", db).await;

let app = add_routes(Router::new(), pg_queue);

Expand Down
Loading

0 comments on commit 46d3102

Please sign in to comment.