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

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Sep 12, 2024
1 parent 99d7efb commit 3ed206a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/analytics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ pub async fn analytics_revenue() {
let pool = test_env.db.pool.clone();

// Generate sample revenue data- directly insert into sql
let (mut insert_user_ids, mut insert_project_ids, mut insert_payouts, mut insert_starts) =
(Vec::new(), Vec::new(), Vec::new(), Vec::new());
let (
mut insert_user_ids,
mut insert_project_ids,
mut insert_payouts,
mut insert_starts,
mut insert_availables,
) = (Vec::new(), Vec::new(), Vec::new(), Vec::new(), Vec::new());

// Note: these go from most recent to least recent
let money_time_pairs: [(f64, DateTime<Utc>); 10] = [
Expand All @@ -47,6 +52,7 @@ pub async fn analytics_revenue() {
insert_project_ids.push(project_id);
insert_payouts.push(Decimal::from_f64_retain(*money).unwrap());
insert_starts.push(*time);
insert_availables.push(*time);
}

let mut transaction = pool.begin().await.unwrap();
Expand All @@ -55,6 +61,7 @@ pub async fn analytics_revenue() {
insert_project_ids,
insert_payouts,
insert_starts,
insert_availables,
&mut transaction,
)
.await
Expand Down

0 comments on commit 3ed206a

Please sign in to comment.