Displaying 1 result from an estimated 1 matches for "collection_test".
2005 Nov 01
0
altering a model for multiple tests
...s a constant PATH.
When in development or production mode, I want PATH == "data/images".
When in test mode, I want PATH == "data/test/images".
Here is my partial solution: The Collection class defines PATH so that
it points the default (non-test) location. In my test file
"collection_test.rb", I overrid that assignment like this:
class Collection < ActiveRecord::Base
PATH = "data/test/images"
end
For a reason I don''t understand, this only works when I alter the
Collection class right in my testcase file. It doesn''t work when I try
to alter it...