Created
May 15, 2009 09:20
-
-
Save lypanov/112137 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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