I'm using ActiveResouce objects which don't have a corresponding
ActiveRecord object in the DB because they're acting as a front end to a
legacy Windows application which can read and write REST type XML.

That works fine, but when I try to do some unit testing
thenActiveSupport::TestCase when it's setting up will try to delete
everything in the tables corresponding to ActiveRecords that it knows
about. Which it should do in preparation to loading fixtures. But in the
case of ActiveResources there's no corresponding table, so it tries to
delete all records in a table, with the name that corresponds to the
ActiveResource, and then fails because it's not there.

E.g. I have an ActiveResouce defined as

class ChoiceCustomers < ActiveResource::Base
etc
end

Now when I try to run the unit test ChoiceCustomerTest <
ActiveSupport::TestCase

even though there's nothing in it apart from the default test, then I
get an error from the database when it tries to "delete from
choice_customers" because there's no corresponding table.

How can I make sure that ActiveSupport::TestCase doesn't regard
ActiveResources as ActiveRecords?
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to