Commit graph

5 commits

Author SHA1 Message Date
Jon Seager
ad4ee2617a
refactor(tests): add generic server helpers and CRUD test macros
- Add `paste` dev-dependency for macro identifier concatenation
- Add `create_entity<P, R>()` generic helper, convert per-entity
  creation helpers to thin wrappers
- Add `define_crud_tests!` macro generating nonexistent-GET/DELETE-404,
  empty-list-200, malformed-JSON-400, and missing-fields-400 tests
- Apply macro to roasters, cafes, cups, and roasts API tests
2026-02-06 14:26:54 +00:00
Jon Seager
42d0f71eb1
feat!: use numeric, database-generated IDs throughout 2025-11-25 18:21:04 +00:00
copilot-swe-agent[bot]
ac355b1b8e
test(server): fix broken tests by adding authentication support
- Update all server tests to use spawn_app_with_auth() helper
- spawn_app_with_auth() creates admin user and test token automatically
- Add helper methods (post/put/delete/get) to TestApp for authenticated requests
- Update create_roaster_with_payload to include auth token when available
- Add bearer_auth() to all write operation test requests
- Fix auth_api test to expect 2 tokens (test helper + test-created)
- All 42 server tests now pass

Co-authored-by: jnsgruk <668505+jnsgruk@users.noreply.github.com>
2025-11-25 16:28:13 +00:00
Jon Seager
f60e759935
test: add simple tests for timeline view 2025-11-24 19:15:45 +00:00
copilot-swe-agent[bot]
996f7b0432
refactor: rename test files to clarify API-only scope
Rename roasters.rs to roasters_api.rs and roasts.rs to roasts_api.rs
to make it clear these files only test the /api/v1 endpoints, not the
page endpoints.

Co-authored-by: jnsgruk <668505+jnsgruk@users.noreply.github.com>
2025-11-24 17:58:25 +00:00
Renamed from tests/server/roasts.rs (Browse further)