Reset column info when messing with columns.

We are subclassing Session here, but messing with the columns will
affect the attribute methods defined on the Session superclass, and
therefore other tests, unless we properly isolate it by resetting column
info before and after the test run.
This commit is contained in:
Jon Leighton
2011-09-11 16:07:24 +01:00
parent eecfa84a90
commit cf115d2f8e

View File

@@ -36,6 +36,7 @@ module ActiveRecord
end
def test_find_by_sess_id_compat
Session.reset_column_information
klass = Class.new(Session) do
def self.session_id_column
'sessid'
@@ -53,6 +54,7 @@ module ActiveRecord
assert_equal session.sessid, found.session_id
ensure
klass.drop_table!
Session.reset_column_information
end
def test_find_by_session_id