chadtmiller.com/knotless
git that lives in your Atmosphere account
1
10
The sites test takes a site down by its repository, its record and its owner
crates/knotless-serve/tests/sites.rs+14−1
| @@ -162,7 +162,20 @@ fn sites_are_served_on_their_domain() { | ||
s.put_record("dev.knotless.site", &rkey, record); | ||
wait_until(|| get(&base, &host, "/site/docs/", &[]).0 == 502); | ||
| ||
// Taken down, it is gone. | ||
// The operator taking down its repository, the site's record or its | ||
// owner takes the site down with them, and restoring brings it back. | ||
let index = app.index.as_ref().unwrap(); | ||
let repo = format!("at://{did}/dev.knotless.repo/site"); | ||
let record = format!("at://{did}/dev.knotless.site/{rkey}"); | ||
for subject in [&repo, &record, &did] { | ||
let why = serde_json::json!({"subject": subject}); | ||
index.take_down(HOME, subject, &why, true).unwrap(); | ||
wait_until(|| get(&base, &host, "/site/", &[]).0 == 404); | ||
index.take_down(HOME, subject, &why, false).unwrap(); | ||
wait_until(|| get(&base, &host, "/site/", &[]).0 == 200); | ||
} | ||
| ||
// Taken down by its owner, it is gone. | ||
assert_eq!(s.cli(&["site", &url, "--down"], b"").0, 0); | ||
wait_until(|| get(&base, &host, "/site/", &[]).0 == 404); | ||
} | ||