Skip to content
Merged
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
10 changes: 6 additions & 4 deletions vendor/wheels/tests/specs/model/queryBuilderSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -279,23 +279,25 @@ component extends="wheels.WheelsTest" {

it("forUpdate() starts a chain", () => {
// FOR UPDATE is a no-op on SQLite/MSSQL; this pins the chain-entry dispatch, not the locking.
// Terminal must be non-aggregate: Postgres/CockroachDB reject COUNT(*) ... FOR UPDATE.
var result = model("author")
.forUpdate()
.where("lastName", "Djurner")
.count();
expect(result).toBe(1);
.get();
expect(result.recordcount).toBe(1);
})

})

describe("scope chain to builder transition", () => {

it("forUpdate() transitions from a scope chain to the query builder", () => {
// Non-aggregate terminal for the same Postgres/CockroachDB FOR UPDATE restriction.
var result = model("authorScoped")
.withLastNameDjurner()
.forUpdate()
.count();
expect(result).toBe(1);
.get();
expect(result.recordcount).toBe(1);
})

})
Expand Down
Loading