Subject says it all. Prior to the upgrade my suite of unit and
functional tests passed without trouble. Now they are broken. Searching
reveals no hints as to why Rails 1.2 causes this. Any input is
appreciated. Below is a description of the behavior I’m noticing (code
is off the cuff, just to get the point across).
- Sessions don’t seem to move properly between functional test method
and the controller method it is testing. Example:
assert session[:cars].drivers.size == 1 # Pass!
post :delete_driver, :driver_id => session[:cars].drivers.id
assert session[:cars].drivers.nil? # Fails! Is still size 1!?!
Method delete_driver is supposed to remove the driver with the passed id
session[:cars]. It works perfectly when I step through it while making a
post during development. However, when posting from inside the test
debugging shows me that session[:cars] is empty immediately upon
entering delete_driver. Yet it is size 1 inside the testing method both
before and after posting to delete_driver.
- Save on assignment. Example:
Causes Exception: Mysql::Error: Column ‘notify’ cannot be null: INSERT
INTO reminders (
notify) VALUES(NULL, 1,
It’s the second line that causes the exception. I do believe I read
somewhere that when adding an object to a collection associated with an
already persisted object (like appointment) that Rails will immediately
save that new collection member. However, this didn’t happen prior to
the 1.2 upgrade. Is this new as of 1.2?
Other tests are failing but I can’t yet describe the failures well (need
to debug more). Point #0 is killing me. Please, any help is greatly