Merged
Conversation
Ensures exposed records can always be found regardless of any default_scope on the model. For example, if a model uses soft-deletes with a default_scope filtering out deleted records, the fixture helper should still return the record since it was explicitly exposed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a soft-delete scenario to the dummy app to verify that exposed records hidden by a default_scope are still accessible via the fixture helper. Updates the existing unit test mocks to reflect the new unscoped call chain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These tests were in a misnamed file (fixture_set_spec.rb for FixtureKit::Repository) and tested implementation details (memoization, laziness) with brittle message expectations tightly coupled to the implementation. The meaningful behaviors are already covered by integration tests (EXPOSED_ACCESS, ARRAY_EXPOSURE, UNSCOPED_RECORD_LOOKUP). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The dummy app sets up tables inline via rails_helper/test_helper, not through migrations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
unscopedso exposed fixture records are always findable regardless of anydefault_scopeon the modeldefault_scopethat filters them out, thefixture.userhelper should still return the record since it was explicitly exposeddefault_scope, you can always skip the helper and find the record yourself (e.g.User.find_by(...))Test plan
default_scopefiltering records, verify exposed record is still found🤖 Generated with Claude Code