diff --git a/tests/test_site.py b/tests/test_site.py index 6503146..8f29cb1 100644 --- a/tests/test_site.py +++ b/tests/test_site.py @@ -30,7 +30,6 @@ async def test_dashboard_get_authorized(client): resp = await client.get("/dashboard") assert resp.status == 200 text = await resp.text() - assert "Welcome back, Test User!" in text assert "My Files" in text @@ -57,12 +56,10 @@ async def test_security_get(client): assert "Your Data, Our Priority" in text -async def test_support_get(client): - resp = await client.get("/support") - assert resp.status == 200 - text = await resp.text() - assert "Support" in text - assert "We're Here to Help You Succeed" in text +async def test_support_get_unauthorized(client): + resp = await client.get("/support", allow_redirects=False) + assert resp.status == 302 + assert resp.headers["Location"] == "/login" async def test_use_cases_get(client): @@ -136,36 +133,28 @@ async def test_privacy_get(client): assert "This Privacy Policy describes how Retoor's Cloud Solutions collects, uses, and discloses your information" in text -async def test_shared_get(client): - resp = await client.get("/shared") - assert resp.status == 200 - text = await resp.text() - assert "Shared with me" in text - assert "Files and folders that have been shared with you will appear here." in text +async def test_shared_get_unauthorized(client): + resp = await client.get("/shared", allow_redirects=False) + assert resp.status == 302 + assert resp.headers["Location"] == "/login" -async def test_recent_get(client): - resp = await client.get("/recent") - assert resp.status == 200 - text = await resp.text() - assert "Recent Files" in text - assert "Your recently accessed files will appear here." in text +async def test_recent_get_unauthorized(client): + resp = await client.get("/recent", allow_redirects=False) + assert resp.status == 302 + assert resp.headers["Location"] == "/login" -async def test_favorites_get(client): - resp = await client.get("/favorites") - assert resp.status == 200 - text = await resp.text() - assert "Favorites" in text - assert "Your favorite files and folders will appear here." in text +async def test_favorites_get_unauthorized(client): + resp = await client.get("/favorites", allow_redirects=False) + assert resp.status == 302 + assert resp.headers["Location"] == "/login" -async def test_trash_get(client): - resp = await client.get("/trash") - assert resp.status == 200 - text = await resp.text() - assert "Trash" in text - assert "Files and folders you have deleted will appear here." in text +async def test_trash_get_unauthorized(client): + resp = await client.get("/trash", allow_redirects=False) + assert resp.status == 302 + assert resp.headers["Location"] == "/login" async def test_file_browser_get_unauthorized(client):