mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-02 02:03:20 -05:00
fix: dash slug names (#5709)
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
144d4caea6
commit
107dfc34de
@@ -929,6 +929,13 @@ def test_create_recipe_with_extremely_long_slug(api_client: TestClient, unique_u
|
||||
assert updated_recipe["slug"] == slugify(new_name)
|
||||
|
||||
|
||||
def test_create_recipe_slug_not_empty(api_client: TestClient, unique_user: TestUser):
|
||||
recipe_name = "---" # will result in an empty slug
|
||||
|
||||
response = api_client.post(api_routes.recipes, json={"name": recipe_name}, headers=unique_user.token)
|
||||
assert response.status_code == 400
|
||||
|
||||
|
||||
def test_create_recipe_slug_length_validation(api_client: TestClient, unique_user: TestUser):
|
||||
"""Test that recipe slugs are properly truncated to a reasonable length."""
|
||||
very_long_name = "A" * 500 # 500 character name
|
||||
|
||||
Reference in New Issue
Block a user