Skip to content

Add acts_as_paranoid test coverage#6862

Merged
compwron merged 2 commits intomainfrom
paranoid-spec
Apr 16, 2026
Merged

Add acts_as_paranoid test coverage#6862
compwron merged 2 commits intomainfrom
paranoid-spec

Conversation

@compwron
Copy link
Copy Markdown
Collaborator

Summary

  • Add spec ensuring all acts_as_paranoid models have (deleted_at IS NULL) conditions on unique indexes
  • Add spec ensuring all paranoid models include the "a soft-deleted model" shared example in their model specs
  • Add RSpec.shared_examples_for "a soft-deleted model" for reusable soft-delete behavior testing (column presence, default scope, unscoped access, uniqueness validations)
  • Add described_class_factory helper to derive factory names from described class

Test plan

  • Run rspec spec/models/acts_as_paranoid_spec.rb — passes with current schema
  • Run rspec spec/models/soft_deleted_model_shared_example_coverage_spec.rb — passes, ContactTopicAnswer and CaseContact tracked as TODOs
  • Verify shared example works when included in a paranoid model spec via it_behaves_like "a soft-deleted model"

🤖 Generated with Claude Code

Add specs to ensure all paranoid models have proper unique index conditions
and include the soft-deleted model shared example. Add shared example for
reusable soft-delete behavior testing and described_class_factory helper.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added ruby Pull requests that update Ruby code Tests! 🎉💖👏 labels Apr 16, 2026
@compwron compwron merged commit 88eb623 into main Apr 16, 2026
11 checks passed
@compwron compwron deleted the paranoid-spec branch April 16, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ruby Pull requests that update Ruby code Tests! 🎉💖👏

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant