Files
onspring-api-sdk-rust/tests/integration_ping.rs
T
Stevan Freeborn a517aef3bd feat: add integration tests and runnable examples
Add 91 integration tests (all #[ignore]) mirroring the JavaScript SDK's
integration test suite. Tests cover all endpoints: ping, apps, fields,
records, files, lists, and reports with success, auth, access, and
not-found scenarios.

Add 7 runnable examples (cargo run --example <name>) for quick manual
smoke testing against a real Onspring instance.

Both use env vars (API_BASE_URL, SANDBOX_API_KEY, TEST_*) matching the
JavaScript SDK setup.

Also rename crate to onspring-api-sdk-rust with [lib] name = "onspring"
so imports remain `use onspring::*`.
2026-03-25 18:57:45 -05:00

19 lines
404 B
Rust

mod integration_common;
use integration_common::{build_client, build_client_with_key};
#[tokio::test]
#[ignore]
async fn ping_should_succeed() {
let client = build_client();
client.ping().await.unwrap();
}
#[tokio::test]
#[ignore]
async fn ping_should_fail_with_invalid_api_key() {
let client = build_client_with_key("invalid");
let result = client.ping().await;
assert!(result.is_err());
}