feat: three nuxt frontends, demo seed, rounding + money-exponent + rate-cast fixes, archived specs
This commit is contained in:
@@ -146,6 +146,15 @@ async fn currency_conversion_math() {
|
||||
assert_eq!(body["amount_minor"], 1500);
|
||||
assert_eq!(body["currency"], "JPY");
|
||||
|
||||
// midpoint rounds half-up (away from zero), not banker's rounding:
|
||||
// 1999 minor USD ($19.99) -> JPY at rate 150 => 2998.5 -> 2999
|
||||
let res = client()
|
||||
.get(app.url("/api/currencies/convert?amount_minor=1999&from=USD&to=JPY"))
|
||||
.send()
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(res.json::<serde_json::Value>().await.unwrap()["amount_minor"], 2999);
|
||||
|
||||
// disabled currency rejected
|
||||
let admin = login_admin(&app).await;
|
||||
let res = client()
|
||||
|
||||
Reference in New Issue
Block a user