A platform for community discussion. Free, open, simple.
DEV: Document fab! syntax patterns in AI-AGENTS.md (#37260)
Alan Guo Xiang Tan8a87e547f5a5
diff --git a/AI-AGENTS.md b/AI-AGENTS.mdindex 900abf68769..12764b3ae4e 100644--- a/AI-AGENTS.md+++ b/AI-AGENTS.md@@ -30,7 +30,12 @@ Discourse is large with long history. Understand context before changes.- Do not write unnecessary comments in tests, every single assertion doesn't need a comment- Don't test functionality handled by other classes/components- Don't write obvious tests-- Ruby: use `fab!()` over `let()`, system tests for UI (`spec/system`), use page objects for system spec finders (`spec/system/page_objects`)+- Ruby: use `fab!` over `let()`, system tests for UI (`spec/system`), use page objects for system spec finders (`spec/system/page_objects`)++### fab! Syntax+- `fab!(:user)` - creates object using Fabricator defaults (name matches fabricator)+- `fab!(:user_1, :user)` - preferred when variable name differs from fabricator, no custom attributes+- `fab!(:user) { Fabricate(:user, username: "some_username") }` - with block for custom attributes### Page Objects (System Specs)- Located in `spec/system/page_objects/pages/`, inherit from `PageObjects::Pages::Base`