Skip to content

test(BEAR-1793): ensure find returns models without pending or previous changes - #40

Draft
pimpin wants to merge 1 commit into
masterfrom
test/find-returns-clean-models
Draft

pimpin wants to merge 1 commit into
masterfrom
test/find-returns-clean-models

Conversation

@pimpin

@pimpin pimpin commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

TL;DR

Extend the regression specs so that models returned by find are verified clean on every change-tracking API.

Why

BEAR-1793: find used to return models with pending changes. It is fixed since 2023 (reset_object! in Base.find), but the spec only asserted changed?.

How

New clean state after find block in spec/base_spec.rb. Each case asserts changed?, changes, changes_to_save, saved_changes and previous_changes are empty:

  • single id
  • several ids
  • find_by_id
  • find(..., with_strict_loading: true)
Evidence of Testing

Syntax checked with ruby -c. Specs not run locally: they need a Couchbase server. CI is the first real run.

Review Focus

Whether the covered APIs and cases are enough.

Documentation
  • None.

This pull request was created with AI assistance.

🤖 Generated with Claude Code

Cover changes, changes_to_save, saved_changes and previous_changes, for
single and multiple ids, find_by_id and strict loading.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pimpin pimpin changed the title test: ensure find returns models without pending or previous changes test(BEAR-1793): ensure find returns models without pending or previous changes Oct 14, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant