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 5, 2024
1 parent d5fd180 commit 2adfd31
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 @@ -172,9 +170,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 @@ -212,9 +208,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 @@ -235,9 +229,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 @@ -258,9 +250,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 2adfd31

Please sign in to comment.