Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ai/wheels/controllers/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Comprehensive guide to testing Wheels controllers using TestBox 5 with modern BD
### Modern Test Structure (TestBox 5)
```cfm
// tests/specs/controllers/ProductsControllerSpec.cfc
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function beforeAll() {
// Setup once before all tests
Expand Down
2 changes: 1 addition & 1 deletion .ai/wheels/models/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Comprehensive guide to testing Wheels models using TestBox 5 with modern BDD (Be
/**
* UserModelSpec - Test User model functionality using BDD
*/
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function run() {
describe("User Model", () => {
Expand Down
16 changes: 8 additions & 8 deletions .ai/wheels/views/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

```cfm
// tests/specs/views/UserViewSpec.cfc
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function run() {
describe("User View Components", () => {
Expand Down Expand Up @@ -39,7 +39,7 @@ component extends="wheels.Testbox" {
### Testing Partials with BDD

```cfm
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function run() {
describe("User Card Partial", () => {
Expand Down Expand Up @@ -107,7 +107,7 @@ component extends="wheels.Testbox" {
### Testing Form Helpers with BDD

```cfm
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function run() {
describe("Form Helper Testing", () => {
Expand Down Expand Up @@ -160,7 +160,7 @@ component extends="wheels.Testbox" {
### Testing View Helpers with BDD

```cfm
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function run() {
describe("View Helper Functions", () => {
Expand Down Expand Up @@ -209,7 +209,7 @@ component extends="wheels.Testbox" {
### Integration Testing with Controllers using BDD

```cfm
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function run() {
describe("View Integration Testing", () => {
Expand Down Expand Up @@ -261,7 +261,7 @@ component extends="wheels.Testbox" {
### Testing AJAX Responses with BDD

```cfm
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function run() {
describe("AJAX Response Testing", () => {
Expand Down Expand Up @@ -306,7 +306,7 @@ component extends="wheels.Testbox" {
### Testing Flash Messages with BDD

```cfm
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function run() {
describe("Flash Message Display", () => {
Expand Down Expand Up @@ -485,7 +485,7 @@ curl -s http://localhost:8080 | grep '#urlFor' # Should return empty (
### Integration Testing Pattern

```cfm
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {
function run() {
describe("Content Verification Tests", () => {

Expand Down
10 changes: 5 additions & 5 deletions .vscode/wheels-test.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"TestBox Spec": {
"prefix": "tbspec",
"body": [
"component extends=\"wheels.Testbox\" {",
"component extends=\"wheels.WheelsTest\" {",
"\t",
"\tfunction run() {",
"\t\t",
Expand All @@ -28,7 +28,7 @@
"Model Test": {
"prefix": "tbmodel",
"body": [
"component extends=\"wheels.Testbox\" {",
"component extends=\"wheels.WheelsTest\" {",
"\t",
"\tfunction run() {",
"\t\t",
Expand Down Expand Up @@ -61,7 +61,7 @@
"Controller Test": {
"prefix": "tbcontroller",
"body": [
"component extends=\"wheels.Testbox\" {",
"component extends=\"wheels.WheelsTest\" {",
"\t",
"\tfunction run() {",
"\t\t",
Expand Down Expand Up @@ -93,7 +93,7 @@
"API Test": {
"prefix": "tbapi",
"body": [
"component extends=\"wheels.Testbox\" {",
"component extends=\"wheels.WheelsTest\" {",
"\t",
"\tfunction run() {",
"\t\t",
Expand Down Expand Up @@ -129,7 +129,7 @@
"Integration Test": {
"prefix": "tbintegration",
"body": [
"component extends=\"wheels.Testbox\" {",
"component extends=\"wheels.WheelsTest\" {",
"\t",
"\tfunction run() {",
"\t\t",
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ tests/

### Model Testing
```cfm
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function beforeAll() {
// Setup for all tests in this spec
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Every variable passed from controller to view needs a cfparam declaration.
- **config()**: All model associations/validations/callbacks and controller filters/verifies go in `config()`
- **Naming**: Models are singular PascalCase (`User.cfc`), controllers are plural PascalCase (`Users.cfc`), table names are plural lowercase (`users`)
- **Parameters**: `params.key` for URL key, `params.user` for form struct, `params.user.firstName` for nested
- **extends**: Models extend `"Model"`, controllers extend `"Controller"`, tests extend `"wheels.Test"` or `"wheels.Testbox"`
- **extends**: Models extend `"Model"`, controllers extend `"Controller"`, tests extend `"wheels.Test"` or `"wheels.WheelsTest"`
- **Associations**: All named params when using options: `hasMany(name="orders")`, `belongsTo(name="user")`, `hasOne(name="profile")`
- **Validations**: Property param is `property` (singular) for single, `properties` (plural) for list: `validatesPresenceOf(properties="name,email")`

Expand Down Expand Up @@ -211,7 +211,7 @@ Helpers: `linkTo(route="user", key=user.id, text="View")`, `urlFor(route="users"
## Testing Quick Reference

```cfm
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {
function run() {
describe("User", function() {
it("validates presence of name", function() {
Expand Down
2 changes: 1 addition & 1 deletion app/snippets/tests/controller.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function beforeAll() {
// Setup test data once for all tests in this component
Expand Down
2 changes: 1 addition & 1 deletion app/snippets/tests/model.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function beforeAll() {
// Setup test data once for all tests in this component
Expand Down
2 changes: 1 addition & 1 deletion app/snippets/tests/view.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function beforeAll() {
// Setup test data once for all tests in this component
Expand Down
12 changes: 6 additions & 6 deletions cli/src/commands/wheels/generate/test.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ component aliases='wheels g test' extends="../base" {
boolean crud = false,
boolean factory = false
) {
var content = 'component extends="wheels.Testbox" {' & chr(10) & chr(10);
var content = 'component extends="wheels.WheelsTest" {' & chr(10) & chr(10);
content &= chr(9) & 'function run() {' & chr(10) & chr(10);
content &= chr(9) & chr(9) & 'describe("#obj.objectNameSingularC# Model", function() {' & chr(10) & chr(10);

Expand Down Expand Up @@ -347,7 +347,7 @@ component aliases='wheels g test' extends="../base" {
boolean crud = false,
boolean mock = false
) {
var content = 'component extends="wheels.Testbox" {' & chr(10) & chr(10);
var content = 'component extends="wheels.WheelsTest" {' & chr(10) & chr(10);
content &= chr(9) & 'function beforeAll() {' & chr(10);
content &= chr(9) & chr(9) & 'variables.baseUrl = "http://localhost:8080";' & chr(10);
content &= chr(9) & '}' & chr(10) & chr(10);
Expand Down Expand Up @@ -421,7 +421,7 @@ component aliases='wheels g test' extends="../base" {
* Generate view test
*/
private function generateViewTest(required struct obj, required string viewName) {
var content = 'component extends="wheels.Testbox" {' & chr(10) & chr(10);
var content = 'component extends="wheels.WheelsTest" {' & chr(10) & chr(10);
content &= chr(9) & 'function beforeAll() {' & chr(10);
content &= chr(9) & chr(9) & 'variables.baseUrl = "http://localhost:8080";' & chr(10);
content &= chr(9) & '}' & chr(10) & chr(10);
Expand Down Expand Up @@ -453,7 +453,7 @@ component aliases='wheels g test' extends="../base" {
* Generate unit test
*/
private function generateUnitTest(required struct obj, boolean mock = false) {
var content = 'component extends="wheels.Testbox" {' & chr(10) & chr(10);
var content = 'component extends="wheels.WheelsTest" {' & chr(10) & chr(10);
content &= chr(9) & 'function run() {' & chr(10) & chr(10);
content &= chr(9) & chr(9) & 'describe("#obj.objectNameSingularC# Unit Tests", function() {' & chr(10) & chr(10);

Expand Down Expand Up @@ -500,7 +500,7 @@ component aliases='wheels g test' extends="../base" {
boolean crud = false,
boolean factory = false
) {
var content = 'component extends="wheels.Testbox" {' & chr(10) & chr(10);
var content = 'component extends="wheels.WheelsTest" {' & chr(10) & chr(10);
content &= chr(9) & 'function beforeAll() {' & chr(10);
content &= chr(9) & chr(9) & 'variables.baseUrl = "http://localhost:8080";' & chr(10);
content &= chr(9) & '}' & chr(10) & chr(10);
Expand Down Expand Up @@ -558,7 +558,7 @@ component aliases='wheels g test' extends="../base" {
boolean crud = false,
boolean mock = false
) {
var content = 'component extends="wheels.Testbox" {' & chr(10) & chr(10);
var content = 'component extends="wheels.WheelsTest" {' & chr(10) & chr(10);
content &= chr(9) & 'function beforeAll() {' & chr(10);
content &= chr(9) & chr(9) & 'variables.apiUrl = "http://localhost:8080/api";' & chr(10);
content &= chr(9) & '}' & chr(10) & chr(10);
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/wheels/plugins/init.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ node_modules/
fileWrite(pluginDir & "/.gitignore", gitignore);

// Create test file
var testFile = 'component extends="wheels.Testbox" {
var testFile = 'component extends="wheels.WheelsTest" {

function run() {
describe("#pluginName# Tests", function() {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/wheels/test/integration.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ component aliases='wheels test:integration' extends="../base" {
* Create a sample integration test file
*/
private void function createSampleIntegrationTest(required string directory) {
var sampleTest = 'component extends="wheels.Testbox" {
var sampleTest = 'component extends="wheels.WheelsTest" {

function beforeAll() {
// Setup test database or test data
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/wheels/test/unit.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ component aliases='wheels test:unit' extends="../base" {
* Create a sample unit test file
*/
private void function createSampleUnitTest(required string directory) {
var sampleTest = 'component extends="wheels.Testbox" {
var sampleTest = 'component extends="wheels.WheelsTest" {

function run() {
describe("Sample Unit Test", function() {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/models/TestService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ component {
boolean crud = false,
boolean mock = false
) {
var content = 'component extends="wheels.Testbox" {' & chr(10) & chr(10);
var content = 'component extends="wheels.WheelsTest" {' & chr(10) & chr(10);

// Add any required properties for mocking
if (arguments.mock) {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/templates/tests/controller.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function run() {

Expand Down
2 changes: 1 addition & 1 deletion cli/src/templates/tests/model.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function run() {

Expand Down
2 changes: 1 addition & 1 deletion cli/src/templates/tests/view.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function run() {

Expand Down
2 changes: 1 addition & 1 deletion design_docs/architecture/wheels-3-architecture-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ tests/

```javascript
// tests/helpers/TestBase.cfc
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function beforeAll() {
// Setup test database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2144,7 +2144,7 @@ component extends="controllers.base.SecureController" {

### Test Structure
```javascript
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

function beforeAll() {
// Set up test environment
Expand Down Expand Up @@ -2410,7 +2410,7 @@ Create a base test class for all command tests:

```javascript
// tests/specs/BaseCommandSpec.cfc
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {

// Properties
property name="originalCWD";
Expand Down
4 changes: 2 additions & 2 deletions design_docs/scratchpad/AI-CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -3116,9 +3116,9 @@ wheels test app tests/specs/models/UserTest.cfc
# Fix: Install TestBox
box install testbox --saveDev

# Error: wheels.Testbox not found
# Error: wheels.WheelsTest not found
# Fix: Ensure test extends correct path and that wheels is installed
# component extends="wheels.Testbox"
# component extends="wheels.WheelsTest"
```

### CLI Module Issues
Expand Down
2 changes: 1 addition & 1 deletion design_docs/scratchpad/AI-CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ component extends="wheels.test" {
}

// For BDD-style tests
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {
// Use with TestBox runner
// Describe/it syntax
// Lifecycle methods
Expand Down
14 changes: 7 additions & 7 deletions design_docs/scratchpad/AI-ERRORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,19 +497,19 @@ Invalid route pattern: '/users/:id'

## Testing Errors

### Error: "wheels.Testbox not found"
### Error: "wheels.WheelsTest not found"

**Symptoms:**
```
Could not find the ColdFusion component or interface wheels.Testbox
Could not find the ColdFusion component or interface wheels.WheelsTest
```

**Cause:** Test not extending wheels.Testbox or path issue
**Cause:** Test not extending wheels.WheelsTest or path issue

**Solution:**
```cfscript
// Correct test setup
component extends="wheels.Testbox" {
component extends="wheels.WheelsTest" {
function run() {
describe("My Test", () => {
it("should work", () => {
Expand Down Expand Up @@ -548,8 +548,8 @@ Cannot rollback transaction, no transaction active

**Solution:**
```cfscript
// Tests automatically use transactions when extending wheels.Testbox
component extends="wheels.Testbox" {
// Tests automatically use transactions when extending wheels.WheelsTest
component extends="wheels.WheelsTest" {
// Don't manually manage transactions
}
```
Expand Down Expand Up @@ -685,7 +685,7 @@ component extends="Migration" {

### Always:
- Use `config()` not `init()` for initialization
- Extend wheels.Testbox for tests
- Extend wheels.WheelsTest for tests
- Check `$performedRenderOrRedirect()` before rendering
- Use proper Wheels syntax for routes `[param]` not `:param`
- Run migrations before testing
Expand Down
Loading