3.4 KiB
testimonials Specification
Purpose
Define testimonial management, publication, authorization, and featured filtering behavior.
Requirements
Requirement: Testimonials are managed with publication control
The system SHALL allow admins to manage testimonials (SPEC WEB-04) with quote text (including multi-paragraph content), author name, optional context (event type and/or date), optional photo with alt text, sort order, featured flag, and published_at. Public rendering MUST preserve paragraph breaks from the stored quote, MUST omit blank/whitespace-only quotes before creating the rendered sequence, and MUST assign alternating left/right reveal directions according to the remaining rendered column order at desktop and mobile viewports. Testimonials sourced from real clients MUST NOT be published to production without authorization; development seeds MAY include the authorized-pending real quotes marked for review.
Scenario: Unpublished testimonial is excluded
- WHEN a testimonial has
published_atnull - THEN the
published()scope MUST exclude it
Scenario: Published testimonial is queryable
- WHEN an admin sets
published_atwith required quote and author name - THEN the testimonial MUST be included in the
published()scope
Scenario: Assistant cannot manage testimonials
- WHEN an assistant attempts to access the testimonials Resource
- THEN access MUST be denied with HTTP 403
Scenario: Featured testimonials are filterable
- WHEN content is queried with featured filter
- THEN records with
is_featuredtrue MUST be retrievable independently of sort order
Scenario: Multi-paragraph quotes render as paragraphs
- GIVEN a published testimonial whose quote contains blank-line separated paragraphs
- WHEN the home testimonials section is rendered
- THEN each paragraph MUST appear as distinct block text rather than a single collapsed line
Scenario: Blank quotes do not affect alternation
- GIVEN the published testimonial collection contains a blank quote between two non-blank quotes
- WHEN the home testimonials section is rendered
- THEN the blank testimonial MUST be omitted
- AND the two rendered testimonials MUST receive alternating
leftandrightdirections based on their rendered order
Scenario: Direction alternation remains on mobile
- WHEN testimonials are viewed at a mobile viewport
- THEN their explicit
leftandrightdirections MUST be preserved with the reduced mobile distance
Requirement: Real wedding testimonials are seeded from authorized source copy
Content and visual seeders SHALL replace fictional testimonials with the five real wedding testimonials from depoimentos.md, preserving author couple names, quote wording, and date/context. Until final publication authorization is confirmed, production deployments MUST keep those records unpublished or gated by explicit admin publish action.
Scenario: Seed loads the five real couples
- WHEN the content seeder runs
- THEN testimonials for Jeniffer e Maick, Quesia e Jhonata, Milena e Weslley, Raquel e Pedro, and Victoria e Pedro MUST exist with their source quotes and marriage context/dates
Scenario: Fictional demo quotes are removed
- WHEN the content seeder completes
- THEN previously invented placeholder testimonial authors MUST NOT remain as the published demo set