Skip to content

Instantly share code, notes, and snippets.

@lypanov
Created May 15, 2009 09:20
Show Gist options
  • Save lypanov/112137 to your computer and use it in GitHub Desktop.
Save lypanov/112137 to your computer and use it in GitHub Desktop.
Spec::Runner.configure do |config|
# disable transactional_fixtures to get webrat working as it doesn't run inside the transactions
config.use_transactional_fixtures = false
# truncate the databases before each run
config.before(:each) do
ActiveRecord::Base.connection.tables.each do |table|
ActiveRecord::Base.connection.execute("DELETE FROM #{table}")
ActiveRecord::Base.connection.execute("DELETE FROM sqlite_sequence where name='#{table}'")
end
ActiveRecord::Base.connection.execute("VACUUM")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment