aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zotapi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/zotapi.rs')
-rw-r--r--tests/zotapi.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/zotapi.rs b/tests/zotapi.rs
index 49dde02..ef58171 100644
--- a/tests/zotapi.rs
+++ b/tests/zotapi.rs
@@ -100,3 +100,17 @@ fn create_new_post_with_title() {
m.assert();
}
+
+#[test]
+fn fetch_xchan_by_address() {
+ let m = mock("GET", "/api/z/1.0/xchan?address=test%40test.com")
+ .match_header("Authorization", Matcher::Regex(r"Basic \w+".into()))
+ .with_status(200)
+ .with_header("content-type", "application/json")
+ .with_body("{}")
+ .create();
+
+ let z = zotapi::client(&format!("http://{}", mockito::SERVER_ADDRESS), "testuser", "test1234");
+ let _res = z.xchan().by_address("test@test.com").fetch().unwrap();
+ m.assert();
+}