strip session-added comments
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
//! Characterization of the classic HTML routes, feeds and the OpenAPI surface,
|
||||
//! recorded before the HTTP layer moves. Statuses are what the app returns today.
|
||||
|
||||
mod support;
|
||||
|
||||
use axum::{
|
||||
@@ -13,7 +10,6 @@ use support::{get, json_request, send};
|
||||
const EMAIL: &str = "owner@example.com";
|
||||
const USERNAME: &str = "owner";
|
||||
|
||||
/// Public classic pages. `{id}`, `{username}`, `{movie}` are replaced by seeded values.
|
||||
const CLASSIC_VISITOR_PAGES: &[(&str, u16)] = &[
|
||||
("/", 200),
|
||||
("/users", 200),
|
||||
@@ -36,7 +32,6 @@ const CLASSIC_VISITOR_PAGES: &[(&str, u16)] = &[
|
||||
("/health", 200),
|
||||
];
|
||||
|
||||
/// Pages that need the signed-in owner.
|
||||
const CLASSIC_OWNER_PAGES: &[(&str, u16)] = &[
|
||||
("/reviews/new", 200),
|
||||
("/diary/export", 200),
|
||||
@@ -64,12 +59,10 @@ const FEDERATION_VISITOR_PAGES: &[(&str, u16)] = &[
|
||||
const FEDERATION_OWNER_PAGES: &[(&str, u16)] = &[
|
||||
("/users/{id}/followers", 303),
|
||||
("/users/{id}/following", 303),
|
||||
// The registered owner is not an admin.
|
||||
("/admin/blocked-domains", 403),
|
||||
("/social/blocked", 200),
|
||||
];
|
||||
|
||||
/// Without federation the collection URLs permanently redirect to the HTML lists.
|
||||
#[cfg(not(feature = "federation"))]
|
||||
const FEDERATION_OFF_PAGES: &[(&str, u16)] = &[
|
||||
("/users/{id}/followers", 308),
|
||||
@@ -80,11 +73,9 @@ struct Seed {
|
||||
router: Router,
|
||||
user_id: String,
|
||||
movie_id: String,
|
||||
/// Cookie header for the signed-in owner (csrf + token).
|
||||
owner_cookie: String,
|
||||
}
|
||||
|
||||
/// One user (registered through the classic form), one movie with a spoiler review, one goal.
|
||||
async fn seed() -> Seed {
|
||||
let (router, pool) = support::server().await;
|
||||
let session = support::register(&router, USERNAME, EMAIL).await;
|
||||
@@ -149,8 +140,6 @@ async fn seed() -> Seed {
|
||||
}
|
||||
}
|
||||
|
||||
/// Inserts a READY 2025 wrap-up record (user scope, or global when `user_id` is None),
|
||||
/// the state the worker leaves behind after generating a report.
|
||||
async fn seed_ready_wrapup(pool: &sqlx::SqlitePool, user_id: Option<&str>) {
|
||||
use chrono::NaiveDate;
|
||||
use domain::models::wrapup::{DateRange, WrapUpScope};
|
||||
@@ -210,7 +199,6 @@ async fn every_classic_page_renders_for_a_visitor() {
|
||||
#[cfg(not(feature = "federation"))]
|
||||
check_table(&seed, FEDERATION_OFF_PAGES, None).await;
|
||||
|
||||
// A dropped wrapup route would also 404, so require the template itself.
|
||||
for template in ["/wrapups/{id}/2025", "/wrapups/global/2025"] {
|
||||
let (status, _, body) = send(&seed.router, get(&expand(&seed, template), None)).await;
|
||||
assert_eq!(status, 200, "{template}");
|
||||
@@ -220,7 +208,6 @@ async fn every_classic_page_renders_for_a_visitor() {
|
||||
);
|
||||
}
|
||||
|
||||
// The owner embeds this widget in an iframe on their personal website.
|
||||
let (status, _, body) = send(
|
||||
&seed.router,
|
||||
get(&expand(&seed, "/users/{id}?embed=true"), None),
|
||||
@@ -245,7 +232,6 @@ async fn every_classic_page_renders_for_the_signed_in_owner() {
|
||||
#[tokio::test]
|
||||
async fn feeds_and_openapi_are_served() {
|
||||
let seed = seed().await;
|
||||
// `/docs` (what users type) redirects to the Swagger UI at `/docs/`.
|
||||
for (template, expected) in [
|
||||
("/feed.rss", 200),
|
||||
("/users/{id}/feed.rss", 200),
|
||||
|
||||
Reference in New Issue
Block a user