Skip to content

Commit

Permalink
updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kav committed May 30, 2023
1 parent 6e6bd23 commit c5053d0
Showing 1 changed file with 5 additions and 29 deletions.
34 changes: 5 additions & 29 deletions wrappers/src/fdw/stripe_fdw/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ mod tests {
None,
);


let results = c
.select("SELECT * FROM stripe_accounts", None, None)
.filter_map(|r| {
Expand Down Expand Up @@ -544,33 +543,6 @@ mod tests {
.collect::<Vec<_>>();
assert_eq!(results, vec!["cus_MJiBgSUgeWFN0z"]);

let results = c
.select("SELECT * FROM checkout_sessions", None, None)
.filter_map(|r| {
r.by_name("id")
.ok()
.and_then(|v| v.value::<&str>())
.zip(r.by_name("customer").ok().and_then(|v| v.value::<&str>()))
.zip(r.by_name("payment_intent").ok().and_then(|v| v.value::<&str>()))
.zip(r.by_name("subscription").ok().and_then(|v| v.value::<&str>()))
})
.collect::<Vec<_>>();
assert_eq!(
results,
vec![(
(
(
(
"cs_test_123",
"cus_MJiBgSUgeWFN0z",
),
"pi_123",
),
"sub_123",
)
)]
);

let results = c
.select(
"SELECT attrs->>'id' as id FROM checkout_sessions",
Expand All @@ -579,7 +551,11 @@ mod tests {
)
.filter_map(|r| r.by_name("id").ok().and_then(|v| v.value::<&str>()))
.collect::<Vec<_>>();
assert_eq!(results, vec!["cs_test_123"]);
assert_eq!(
results,
vec!["cs_test_a1DmlfbOPqmbKHfpwpFQ0RM3pVXmKoESZbJxnKrPdMsLDPPMGYtEBcHGPR"]
);

// Stripe mock service cannot return 404 error code correctly for
// non-exists customer, so we have to disable this test case.
//
Expand Down

0 comments on commit c5053d0

Please sign in to comment.