From 257cb1536e7aa4a356aecd005c4bdd193d0e38d1 Mon Sep 17 00:00:00 2001 From: Fernando Blat Date: Wed, 19 Jan 2011 12:11:03 +0100 Subject: [PATCH] Truncate tables on each spec --- spec/spec_helper.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1cdd0190a3..8c55eea391 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -10,13 +10,9 @@ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} RSpec.configure do |config| config.mock_with :mocha - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - # config.fixture_path = "#{::Rails.root}/spec/fixtures" - - # If you're not using ActiveRecord, or you'd prefer not to run each of your - # examples within a transaction, remove the following line or assign false - # instead of true. - # config.use_transactional_fixtures = true - config.include CartoDB::Factories + + config.before(:each) do + Rails::Sequel.connection.tables.each{ |t| next if t == :schema_migrations; Rails::Sequel.connection[t].truncate } + end end