Jan 30

Help! Rails test cases do not remove fixture data

Check if target database table is of MyIsam type. You have two options, first is not to use transactional fixtures in tests:
self.use_transactional_fixtures = false

Second and better option is to convert all tables to InnoDB tables. This migration can help converting:

class MyIsam2InnoDb < ActiveRecord::Migration
  def self.up
    ActiveRecord::Base.connection.tables.each {|t| 
        execute "ALTER TABLE #{t} TYPE=InnoDB"}
  end

  def self.down
  end
end