Skip to content

Misleading documentation on use_transactional_fixtures behavior in RSpec #2839

@aandrieu

Description

@aandrieu

Hello.

In the RSpec documentation, it states that setting use_transactional_fixtures = true will "run every test method within a transaction." However, this seems to be misleading, as checking the ActiveRecord::Base.current_transaction.open? status during a test shows false, even though we are inside a transaction.

The documentation suggests that the transaction will be "visible" during tests, but this is not the case when checking current_transaction.open?. This behavior creates confusion for me, as it would be reasonable to assume that Rails is aware of the transaction in the context of the test, but current_transaction.open? indicates otherwise.

Is it something that should be clarified in the Transaction doc?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions