views:

23

answers:

2

When I run 'rake test' I get this error:

1) Error: test_the_truth(DetailsThankYouTest): ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: details: DELETE FROM "details" WHERE 1=1

The application runs fine but I cannot write any simple test. How can I disable Rails test to use the table?

+1  A: 

Presumably you have a class which doesn't have a table itself but which has subclasses which do. In which case you can set:

class Details < ActiveRecord::Base
  self.abstract_class = true
end
Shadwell
I do not have any subclass, but that's a good advise anyway
rtacconi
+1  A: 

Did you add a fixture file for this model by accident?

According to the testing guide:

Rails by default automatically loads all fixtures from the test/fixtures folder for your unit and functional test. Loading involves (...) removing any existing data from the table corresponding to the fixture.

Matt
Yes the test_helper.rb does that
rtacconi