Skip to content

Conversation

@moofkit
Copy link

@moofkit moofkit commented Oct 27, 2025

Even when use_active_record = false is set, rspec-rails still included ActiveRecord::TestFixtures and intercepted before and after hooks, attempting to access the databases associated with active record models. This caused issues in non-standard Rails projects where ActiveRecord is present but not using the Rails testing framework directly.

This PR allows projects with ActiveRecord present to cleanly opt-out of fixture-based testing without database hook interference.

Changes

  • moved ActiveRecord::TestFixtures inclusion inside the use_active_record? conditional check
  • created ActiveRecord.md guide covering fixtures, transactions, and configuration options. Merged Transactions.md to the new document
  • updated rails_helper.rb comments to be aligned with updated documentation.

@JonRowe JonRowe changed the title Avoid loading active record test fuxtures Avoid loading active record fixtures Oct 27, 2025
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