Skip to content

Instantly share code, notes, and snippets.

@corroded
Created April 11, 2011 09:01
Show Gist options
  • Save corroded/913257 to your computer and use it in GitHub Desktop.
Save corroded/913257 to your computer and use it in GitHub Desktop.
put this in features/support/env.rb right after: if defined?(ActiveRecord::Base) begin require 'database_cleaner' DatabaseCleaner.strategy = :truncation rescue LoadError => ignore_if_database_cleaner_not_present end en
Before do
#Seed the DB
Fixtures.reset_cache
fixtures_folder = File.join(RAILS_ROOT, 'test', 'fixtures')
fixtures = Dir[File.join(fixtures_folder, '*.yml')].map {|f| File.basename(f, '.yml') }
Fixtures.create_fixtures(fixtures_folder, fixtures)
puts "Loading fixtures...."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment