Skip to content

Commit f794f1f

Browse files
bpamiriclaude
andauthored
refactor(test): move core framework specs from app to core test suite (#2011) (#2200)
Eleven specs under tests/specs/ were exercising core framework APIs (findEach/findInBatches, query builder, scopes, enums, pagination helpers, middleware pipeline/order-resolver/rate-limiter, route model binding, env() helper) but lived in the application test suite where they never ran as part of the engines x databases CI matrix. Move all eleven plus their fixture models into vendor/wheels/tests/specs/ so they run in the core suite, keeping tests/specs/ minimal as a starter template (just ExampleSpec.cfc). Back-port the status column and enum seed rows to core populate.cfm for EnumSpec; update crudSpec expanded alias expectations to include the new column. Rewrite the six dotted CFC references in MiddlewarePipelineSpec from tests.specs.middleware._helpers.* to wheels.tests.specs.middleware._helpers.*. Port unique fixed/sliding/ tokenBucket pipeline-integration assertions from the app-level RateLimiterSpec into the core spec, then delete the duplicate. Also repair the MiddlewareOrderResolverSpec $entry helper — the spec was authored against an assumed first-arg name but the resolver uses pluginName as the default name, so before/after constraints never matched. Now that the spec actually runs, pass name explicitly in options so the constraints resolve. Closes #2011 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e0f8cd9 commit f794f1f

19 files changed

Lines changed: 273 additions & 397 deletions

tests/populate.cfm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ application.wo.model("author").create(firstName = "Adam", lastName = "Chapman");
106106
application.wo.model("author").create(firstName = "Tom", lastName = "King");
107107
application.wo.model("author").create(firstName = "David", lastName = "Belanger");
108108
109-
// Create posts with various statuses
109+
// Seed a handful of posts for scaffold/generator examples.
110110
local.per = application.wo.model("author").findOne(where = "firstName = 'Per'");
111-
local.per.createPost(title = "First post", body = "Body 1", views = 5, status = "published");
112-
local.per.createPost(title = "Second post", body = "Body 2", views = 5, status = "published");
113-
local.per.createPost(title = "Third post", body = "Body 3", views = 0, averageRating = "3.2", status = "archived");
111+
local.per.createPost(title = "First post", body = "Body 1", views = 5);
112+
local.per.createPost(title = "Second post", body = "Body 2", views = 5);
113+
local.per.createPost(title = "Third post", body = "Body 3", views = 0, averageRating = "3.2");
114114
115115
local.tony = application.wo.model("author").findOne(where = "firstName = 'Tony'");
116-
local.tony.createPost(title = "Fourth post", body = "Body 4", views = 3, averageRating = "3.6", status = "draft");
117-
local.tony.createPost(title = "Fifth post", body = "Body 5", views = 2, averageRating = "3.6", status = "draft");
116+
local.tony.createPost(title = "Fourth post", body = "Body 4", views = 3, averageRating = "3.6");
117+
local.tony.createPost(title = "Fifth post", body = "Body 5", views = 2, averageRating = "3.6");
118118
</cfscript>

tests/specs/middleware/RateLimiterSpec.cfc

Lines changed: 0 additions & 377 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)