This project is archived and is in readonly mode.

#5301 ✓committed
Andrew Kaspick

[PATCH] integration test sessions fixture fix

Reported by Andrew Kaspick | August 4th, 2010 @ 08:49 PM

In integration tests when creating a new session with open_session, fixtures would no longer be accessible in the new session.


# works
companies(:test)

open_session do |sess|
  # fixtures not accessible on sess... error
  #sess.companies(:test)
end

The code was broken because the existing session instance adds the fixture methods by checking if the current session responds to the fixture method name with respond_to?, but the fixture methods are private and would return false which would prevent the fixture methods in the new session from being created. Passing true to respond_to? checks private methods as well, which would then return true and then create the fixture access methods in the new session.

The patch should explain the issue more clearly.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages