Skip to content

Commit

Permalink
Merge pull request #2 from montdidier/fix/charge_tests
Browse files Browse the repository at this point in the history
fix charge tests
  • Loading branch information
montdidier authored Dec 19, 2023
2 parents c9ce38f + f06aedd commit 6e21e0a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/charge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async fn charge_create_test() {
.body(serde_json::to_string(&json).expect("failed to serialize body"))),
);

let client = Client::from_url(server.url_str("/").as_str(), "sk_test_12345");
let client = Client::from_url(server.url_str("/1/").as_str(), "sk_test_12345");

let charge = Charge::create(
&client,
Expand Down Expand Up @@ -110,7 +110,7 @@ async fn get_charge_test() {

let token = "ch_lfUYEBK14zotCTykezJkfg".parse().unwrap();

let client = Client::from_url(server.url_str("/").as_str(), "sk_test_12345");
let client = Client::from_url(server.url_str("/1/").as_str(), "sk_test_12345");
let charge = Charge::retrieve(&client, &token).await.unwrap();

assert_eq!(charge.token, "ch_lfUYEBK14zotCTykezJkfg");
Expand All @@ -137,7 +137,7 @@ async fn charge_void_test() {

let token = "ch_lfUYEBK14zotCTykezJkfg".parse().unwrap();

let client = Client::from_url(server.url_str("/").as_str(), "sk_test_12345");
let client = Client::from_url(server.url_str("/1/").as_str(), "sk_test_12345");
let charge = Charge::void(&client, &token).await.unwrap();

assert_eq!(charge.token, "ch_lfUYEBK14zotCTykezJkfg");
Expand Down Expand Up @@ -166,7 +166,7 @@ async fn charge_capture_test() {

let token = "ch_lfUYEBK14zotCTykezJkfg".parse().unwrap();

let client = Client::from_url(server.url_str("/").as_str(), "sk_test_12345");
let client = Client::from_url(server.url_str("/1/").as_str(), "sk_test_12345");
let charge = Charge::capture(&client, &token).await.unwrap();

assert_eq!(charge.token, "ch_lfUYEBK14zotCTykezJkfg");
Expand All @@ -188,7 +188,7 @@ async fn charge_list_test() {
respond_with(json_encoded(json)),
);

let client = Client::from_url(server.url_str("/").as_str(), "sk_test_12345");
let client = Client::from_url(server.url_str("/1/").as_str(), "sk_test_12345");
let charges = Charge::list(&client, None, None).await.unwrap();

assert_eq!(charges.items[0].token, "ch_lfUYEBK14zotCTykezJkfg");
Expand Down Expand Up @@ -217,7 +217,7 @@ async fn charge_verify_test() {

let session_token = "se_sGt9PuNYfVzJqTSLP2CV8g".parse().unwrap();

let client = Client::from_url(server.url_str("/").as_str(), "sk_test_12345");
let client = Client::from_url(server.url_str("/1/").as_str(), "sk_test_12345");
let charge = Charge::verify(&client, &session_token).await.unwrap();

assert_eq!(charge.success, true);
Expand Down

0 comments on commit 6e21e0a

Please sign in to comment.